Make git-check-format-ref a builtin.
PATCH 1/1 Make git-check-format-ref a builtin.
Signed-off-by Lukas Sandström <[email protected]>
---
It was already written in C, but now it's 219k less in my ~/bin dir.
Makefile | 4 ++-- builtin-check-ref-format.c | 13 +++++++++++++ builtin.h | 2 ++ git.c | 1 + 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 builtin-check-ref-format.c
2e18872b12d1635a6814053f3cfc3c9e433db428
Makefile +2 -2
@@ -170,7 +170,7 @@ PROGRAMS = \ BUILT_INS = git-log$X git-whatchanged$X git-show$X \ git-count-objects$X git-diff$X git-push$X \ - git-grep$X git-add$X + git-grep$X git-add$X git-check-ref-format$X # what 'all' will build and 'install' will install, in gitexecdir ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
@@ -218,7 +218,7 @@ LIB_OBJS = \ BUILTIN_OBJS = \ builtin-log.o builtin-help.o builtin-count.o builtin-diff.o builtin-push.o \ - builtin-grep.o builtin-add.o + builtin-grep.o builtin-add.o builtin-check-ref-format.o GITLIBS = $(LIB_FILE) $(XDIFF_LIB) LIBS = $(GITLIBS) -lz
builtin-check-ref-format.c new file +13 -0
@@ -0,0 +1,13 @@ +/* +* GIT - The information manager from hell +*/ + +#include "cache.h" +#include "refs.h" + +int cmd_check_ref_format (int argc,const char **argv,char **envp) +{ +if (argc !=2 ) +usage ("git check-ref-format refname" ); +return check_ref_format (argv[1 ]) ==0 ?0 :1 ; +}
builtin.h +2 -0
@@ -27,4 +27,6 @@ extern int cmd_push(int argc, const charextern int cmd_grep (int argc,const char **argv,char **envp);extern int cmd_add (int argc,const char **argv,char **envp); +extern int cmd_check_ref_format (int argc,const char **argv,char **envp); +#endif
git.c +1 -0
@@ -52,6 +52,7 @@ static void handle_internal_command(int { "diff", cmd_diff }, { "grep", cmd_grep }, { "add", cmd_add }, + { "check-ref-format", cmd_check_ref_format } };int i;
Signature · 1 line
1.3.2.g3c45-dirty
PATCH 1/1 Remove the non-builtin git-check-ref-format
Signed-off-by Lukas Sandström <[email protected]>
---
Makefile | 2 +- check-ref-format.c | 17 ----------------- 2 files changed, 1 insertions(+), 18 deletions(-) delete mode 100644 check-ref-format.c
d459dd88b8b541bbfa03bb3bebfac152d3d1b9e5
Makefile +1 -1
@@ -164,7 +164,7 @@ PROGRAMS = \ git-ssh-upload$X git-tar-tree$X git-unpack-file$X \ git-unpack-objects$X git-update-index$X git-update-server-info$X \ git-upload-pack$X git-verify-pack$X git-write-tree$X \ - git-update-ref$X git-symbolic-ref$X git-check-ref-format$X \ + git-update-ref$X git-symbolic-ref$X \ git-name-rev$X git-pack-redundant$X git-repo-config$X git-var$X \ git-describe$X git-merge-tree$X git-blame$X git-imap-send$X
check-ref-format.c deleted +0 -17
@@ -1,17 +0,0 @@ -/* -* GIT - The information manager from hell -*/ - -#include "cache.h" -#include "refs.h" - -#include <stdio.h> - -int main (int ac,char **av) -{ -if (ac !=2 ) -usage ("git-check-ref-format refname" ); -if (check_ref_format (av[1 ])) -exit (1 ); -return 0 ; -}
Signature · 1 line
1.3.2.g3c45-dirty