From 8f615493e6b6fd47bc4011c264cb7e6f01052d37 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 2 Aug 2006 11:28:16 -0400 Subject: [PATCH 1/5] git-push: allow -f as an alias for --force This was already documented in the options section of the manpage. This patch implements it, adds it to the usage message, and mentions it at the top of the manpage. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- Documentation/git-push.txt | 2 +- builtin-push.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt index 56afd64f42..d4ae99fa53 100644 --- a/Documentation/git-push.txt +++ b/Documentation/git-push.txt @@ -8,7 +8,7 @@ git-push - Update remote refs along with associated objects SYNOPSIS -------- -'git-push' [--all] [--tags] [--force] ... +'git-push' [--all] [--tags] [-f | --force] ... DESCRIPTION ----------- diff --git a/builtin-push.c b/builtin-push.c index a824171066..c39dd1e092 100644 --- a/builtin-push.c +++ b/builtin-push.c @@ -8,7 +8,7 @@ #define MAX_URI (16) -static const char push_usage[] = "git push [--all] [--tags] [--force] [...]"; +static const char push_usage[] = "git push [--all] [--tags] [-f | --force] [...]"; static int all = 0, tags = 0, force = 0, thin = 1; static const char *execute = NULL; @@ -291,7 +291,7 @@ int cmd_push(int argc, const char **argv, const char *prefix) tags = 1; continue; } - if (!strcmp(arg, "--force")) { + if (!strcmp(arg, "--force") || !strcmp(arg, "-f")) { force = 1; continue; } From ec19a22b74d39da1bf22e10acadc7f712a4976c5 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 2 Aug 2006 11:37:42 -0400 Subject: [PATCH 2/5] git-push: remove obsolete git-push.sh This was converted to a C builtin over three months ago. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- git-push.sh | 87 ----------------------------------------------------- 1 file changed, 87 deletions(-) delete mode 100755 git-push.sh diff --git a/git-push.sh b/git-push.sh deleted file mode 100755 index 21775fc21a..0000000000 --- a/git-push.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/sh - -USAGE='[--all] [--tags] [--force] [...]' -. git-sh-setup - -# Parse out parameters and then stop at remote, so that we can -# translate it using .git/branches information -has_all= -has_force= -has_exec= -has_thin=--thin -remote= -do_tags= - -while case "$#" in 0) break ;; esac -do - case "$1" in - --all) - has_all=--all ;; - --tags) - do_tags=yes ;; - --force) - has_force=--force ;; - --exec=*) - has_exec="$1" ;; - --thin) - ;; # noop - --no-thin) - has_thin= ;; - -*) - usage ;; - *) - set x "$@" - shift - break ;; - esac - shift -done -case "$#" in -0) - echo "Where would you want to push today?" - usage ;; -esac - -. git-parse-remote -remote=$(get_remote_url "$@") - -case "$has_all" in ---all) - set x ;; -'') - case "$do_tags,$#" in - yes,1) - set x $(cd "$GIT_DIR/refs" && find tags -type f -print) ;; - yes,*) - set x $(cd "$GIT_DIR/refs" && find tags -type f -print) \ - $(get_remote_refs_for_push "$@") ;; - ,*) - set x $(get_remote_refs_for_push "$@") ;; - esac -esac - -shift ;# away the initial 'x' - -# $# is now 0 if there was no explicit refspec on the command line -# and there was no default refspec to push from remotes/ file. -# we will let git-send-pack to do its "matching refs" thing. - -case "$remote" in -git://*) - die "Cannot use READ-ONLY transport to push to $remote" ;; -rsync://*) - die "Pushing with rsync transport is deprecated" ;; -esac - -set x "$remote" "$@"; shift -test "$has_all" && set x "$has_all" "$@" && shift -test "$has_force" && set x "$has_force" "$@" && shift -test "$has_exec" && set x "$has_exec" "$@" && shift -test "$has_thin" && set x "$has_thin" "$@" && shift - -case "$remote" in -http://* | https://*) - exec git-http-push "$@";; -*) - exec git-send-pack "$@";; -esac From 7fe08af485a02e28ea11b978e6543fbb78d80943 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 2 Aug 2006 12:32:32 -0400 Subject: [PATCH 3/5] Documentation: convert uses of git-link macro to gitlink There isn't and never was such a macro; all uses are typos. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- Documentation/config.txt | 6 +++--- Documentation/git-cvsimport.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index e669003f72..d89916bea7 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -223,14 +223,14 @@ showbranch.default:: See gitlink:git-show-branch[1]. tar.umask:: - By default, git-link:git-tar-tree[1] sets file and directories modes + By default, gitlink:git-tar-tree[1] sets file and directories modes to 0666 or 0777. While this is both useful and acceptable for projects such as the Linux Kernel, it might be excessive for other projects. With this variable, it becomes possible to tell - git-link:git-tar-tree[1] to apply a specific umask to the modes above. + gitlink:git-tar-tree[1] to apply a specific umask to the modes above. The special value "user" indicates that the user's current umask will be used. This should be enough for most projects, as it will lead to - the same permissions as git-link:git-checkout[1] would use. The default + the same permissions as gitlink:git-checkout[1] would use. The default value remains 0, which means world read-write. user.email:: diff --git a/Documentation/git-cvsimport.txt b/Documentation/git-cvsimport.txt index b0c6d7c303..d21d66bfeb 100644 --- a/Documentation/git-cvsimport.txt +++ b/Documentation/git-cvsimport.txt @@ -116,7 +116,7 @@ file each time git-cvsimport is run. + It is not recommended to use this feature if you intend to export changes back to CVS again later with -git-link[1]::git-cvsexportcommit. +gitlink:git-cvsexportcommit[1]. OUTPUT ------ From d4ad9b0484fa17de3d161f48ae58190ec2cccd45 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Wed, 2 Aug 2006 12:34:44 -0400 Subject: [PATCH 4/5] git-annotate: remove extraneous debugging line Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- git-annotate.perl | 1 - 1 file changed, 1 deletion(-) diff --git a/git-annotate.perl b/git-annotate.perl index 6db2f48241..505b5ccb28 100755 --- a/git-annotate.perl +++ b/git-annotate.perl @@ -317,7 +317,6 @@ sub _git_diff_parse { $gotheader = 1; - printf("Copying from %d to %d\n", $ri, $remstart); foreach my $parent (@$parents) { for (my $i = $ri; $i < $remstart; $i++) { $plines{$parent}[$pi{$parent}++] = $slines->[$i]; From 53bb2c002a53cdd0746444defbf5323ea21eb8d5 Mon Sep 17 00:00:00 2001 From: Matthias Kestenholz Date: Wed, 2 Aug 2006 18:32:32 +0200 Subject: [PATCH 5/5] Make git-prune-packed a builtin Signed-off-by: Matthias Kestenholz Signed-off-by: Junio C Hamano --- Makefile | 6 +++--- prune-packed.c => builtin-prune-packed.c | 4 +--- builtin.h | 1 + git.c | 1 + 4 files changed, 6 insertions(+), 6 deletions(-) rename prune-packed.c => builtin-prune-packed.c (95%) diff --git a/Makefile b/Makefile index e66e9b16a5..fd45cd19b1 100644 --- a/Makefile +++ b/Makefile @@ -178,7 +178,7 @@ PROGRAMS = \ git-hash-object$X git-index-pack$X git-local-fetch$X \ git-merge-base$X \ git-merge-index$X git-mktag$X git-mktree$X git-pack-objects$X git-patch-id$X \ - git-peek-remote$X git-prune-packed$X git-receive-pack$X \ + git-peek-remote$X git-receive-pack$X \ git-send-pack$X git-shell$X \ git-show-index$X git-ssh-fetch$X \ git-ssh-upload$X git-unpack-file$X \ @@ -197,7 +197,7 @@ BUILT_INS = git-log$X git-whatchanged$X git-show$X git-update-ref$X \ git-read-tree$X git-commit-tree$X git-write-tree$X \ git-apply$X git-show-branch$X git-diff-files$X git-update-index$X \ git-diff-index$X git-diff-stages$X git-diff-tree$X git-cat-file$X \ - git-fmt-merge-msg$X git-prune$X git-mv$X + git-fmt-merge-msg$X git-prune$X git-mv$X git-prune-packed$X # what 'all' will build and 'install' will install, in gitexecdir ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS) @@ -254,7 +254,7 @@ BUILTIN_OBJS = \ builtin-diff-index.o builtin-diff-stages.o builtin-diff-tree.o \ builtin-cat-file.o builtin-mailsplit.o builtin-stripspace.o \ builtin-update-ref.o builtin-fmt-merge-msg.o builtin-prune.o \ - builtin-mv.o + builtin-mv.o builtin-prune-packed.o GITLIBS = $(LIB_FILE) $(XDIFF_LIB) LIBS = $(GITLIBS) -lz diff --git a/prune-packed.c b/builtin-prune-packed.c similarity index 95% rename from prune-packed.c rename to builtin-prune-packed.c index d24b097114..d0ff336c14 100644 --- a/prune-packed.c +++ b/builtin-prune-packed.c @@ -54,12 +54,10 @@ static void prune_packed_objects(void) } } -int main(int argc, char **argv) +int cmd_prune_packed(int argc, char **argv, const char *prefix) { int i; - setup_git_directory(); - for (i = 1; i < argc; i++) { const char *arg = argv[i]; diff --git a/builtin.h b/builtin.h index f10d3b77c8..7ddfe2891c 100644 --- a/builtin.h +++ b/builtin.h @@ -20,6 +20,7 @@ extern int cmd_format_patch(int argc, const char **argv, const char *prefix); extern int cmd_count_objects(int argc, const char **argv, const char *prefix); extern int cmd_prune(int argc, const char **argv, const char *prefix); +extern int cmd_prune_packed(int argc, const char **argv, const char *prefix); extern int cmd_push(int argc, const char **argv, const char *prefix); extern int cmd_grep(int argc, const char **argv, const char *prefix); diff --git a/git.c b/git.c index 110e82e9ac..5b50762de1 100644 --- a/git.c +++ b/git.c @@ -263,6 +263,7 @@ static void handle_internal_command(int argc, const char **argv, char **envp) { "fmt-merge-msg", cmd_fmt_merge_msg, NEEDS_PREFIX }, { "prune", cmd_prune, NEEDS_PREFIX }, { "mv", cmd_mv, NEEDS_PREFIX }, + { "prune-packed", cmd_prune_packed, NEEDS_PREFIX }, }; int i;