From 25fb62905890d7860f742b4f2215fdf754ae7fee Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 13 Dec 2006 00:59:58 -0800 Subject: [PATCH 1/5] git-push: document removal of remote ref with : pathspec Signed-off-by: Junio C Hamano --- Documentation/git-push.txt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt index d4ae99fa53..197f4b512f 100644 --- a/Documentation/git-push.txt +++ b/Documentation/git-push.txt @@ -49,12 +49,14 @@ corresponding remotes file---see below), then all the refs that exist both on the local side and on the remote side are updated. + -Some short-cut notations are also supported. +`tag ` means the same as `refs/tags/:refs/tags/`. + -* `tag ` means the same as `refs/tags/:refs/tags/`. -* A parameter without a colon is equivalent to - `:`, hence updates in the destination from - in the source. +A parameter without a colon is equivalent to +`:`, hence updates in the destination from +in the source. ++ +Pushing an empty allows you to delete the ref from +the remote repository. \--all:: Instead of naming each ref to push, specifies that all @@ -75,7 +77,8 @@ include::urls.txt[] Author ------ -Written by Junio C Hamano +Written by Junio C Hamano , later rewritten in C +by Linus Torvalds Documentation -------------- From a159ca0cb7e0acdd37cb066327dcb020d95602d0 Mon Sep 17 00:00:00 2001 From: Andy Parkins Date: Wed, 13 Dec 2006 09:13:28 +0000 Subject: [PATCH 2/5] Allow subcommand.color and color.subcommand color configuration While adding colour to the branch command it was pointed out that a config option like "branch.color" conflicts with the pre-existing "branch.something" namespace used for specifying default merge urls and branches. The suggested solution was to flip the order of the components to "color.branch", which I did for colourising branch. This patch does the same thing for - git-log (color.diff) - git-status (color.status) - git-diff (color.diff) - pager (color.pager) I haven't removed the old config options; but they should probably be deprecated and eventually removed to prevent future namespace collisions. I've done this deprecation by changing the documentation for the config file to match the new names; and adding the "color.XXX" options to contrib/completion/git-completion.bash. Unfortunately git-svn reads "diff.color" and "pager.color"; which I don't like to change unilaterally. Signed-off-by: Andy Parkins Signed-off-by: Junio C Hamano --- Documentation/config.txt | 12 ++++++------ builtin-log.c | 2 +- config.c | 2 +- contrib/completion/git-completion.bash | 3 +++ diff.c | 4 ++-- wt-status.c | 4 ++-- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index 21ec55797b..f5a552ee87 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -137,16 +137,16 @@ branch..merge:: this option, `git pull` defaults to merge the first refspec fetched. Specify multiple values to get an octopus merge. -pager.color:: +color.pager:: A boolean to enable/disable colored output when the pager is in use (default is true). -diff.color:: +color.diff:: When true (or `always`), always use colors in patch. When false (or `never`), never. When set to `auto`, use colors only when the output is to the terminal. -diff.color.:: +color.diff.:: Use customized color for diff colorization. `` specifies which part of the patch to use the specified color, and is one of `plain` (context text), `meta` @@ -271,19 +271,19 @@ showbranch.default:: The default set of branches for gitlink:git-show-branch[1]. See gitlink:git-show-branch[1]. -status.color:: +color.status:: A boolean to enable/disable color in the output of gitlink:git-status[1]. May be set to `true` (or `always`), `false` (or `never`) or `auto`, in which case colors are used only when the output is to a terminal. Defaults to false. -status.color.:: +color.status.:: Use customized color for status colorization. `` is one of `header` (the header text of the status message), `updated` (files which are updated but not committed), `changed` (files which are changed but not updated in the index), or `untracked` (files which are not tracked by git). The values of - these variables may be specified as in diff.color.. + these variables may be specified as in color.diff.. tar.umask:: By default, gitlink:git-tar-tree[1] sets file and directories modes diff --git a/builtin-log.c b/builtin-log.c index 7acf5d3b0c..6821a08442 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -118,7 +118,7 @@ static int git_format_config(const char *var, const char *value) strcat(extra_headers, value); return 0; } - if (!strcmp(var, "diff.color")) { + if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) { return 0; } return git_log_config(var, value); diff --git a/config.c b/config.c index 3cae3901aa..1bdef44a3a 100644 --- a/config.c +++ b/config.c @@ -314,7 +314,7 @@ int git_default_config(const char *var, const char *value) return 0; } - if (!strcmp(var, "pager.color")) { + if (!strcmp(var, "pager.color") || !strcmp(var, "color.pager")) { pager_use_color = git_config_bool(var,value); return 0; } diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 447ec20467..9c4d23a23c 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -712,10 +712,13 @@ _git_repo_config () core.legacyHeaders i18n.commitEncoding diff.color + color.diff diff.renameLimit diff.renames pager.color + color.pager status.color + color.status log.showroot show.difftree showbranch.default diff --git a/diff.c b/diff.c index 33153787b8..726b01e75e 100644 --- a/diff.c +++ b/diff.c @@ -60,7 +60,7 @@ int git_diff_ui_config(const char *var, const char *value) diff_rename_limit_default = git_config_int(var, value); return 0; } - if (!strcmp(var, "diff.color")) { + if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) { diff_use_color_default = git_config_colorbool(var, value); return 0; } @@ -74,7 +74,7 @@ int git_diff_ui_config(const char *var, const char *value) diff_detect_rename_default = DIFF_DETECT_RENAME; return 0; } - if (!strncmp(var, "diff.color.", 11)) { + if (!strncmp(var, "diff.color.", 11) || !strncmp(var, "color.diff.", 11)) { int slot = parse_diff_color_slot(var, 11); color_parse(value, var, diff_colors[slot]); return 0; diff --git a/wt-status.c b/wt-status.c index de1be5bc66..df582a03ef 100644 --- a/wt-status.c +++ b/wt-status.c @@ -297,11 +297,11 @@ void wt_status_print(struct wt_status *s) int git_status_config(const char *k, const char *v) { - if (!strcmp(k, "status.color")) { + if (!strcmp(k, "status.color") || !strcmp(k, "color.status")) { wt_status_use_color = git_config_colorbool(k, v); return 0; } - if (!strncmp(k, "status.color.", 13)) { + if (!strncmp(k, "status.color.", 13) || !strncmp(k, "color.status", 13)) { int slot = parse_status_slot(k, 13); color_parse(v, k, wt_status_colors[slot]); } From b42a044f5942c64bbc94aa2f4637d8290748e634 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 24 Nov 2006 22:38:18 -0800 Subject: [PATCH 3/5] git-svn: exit with status 1 for test failures Some versions of the SVN libraries cause die() to exit with 255, and 40cf043389ef4cdf3e56e7c4268d6f302e387fa0 tightened up test_expect_failure to reject return values >128. Signed-off-by: Eric Wong Signed-off-by: Junio C Hamano --- git-svn.perl | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/git-svn.perl b/git-svn.perl index b53273eaea..e8b5c0966b 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -21,6 +21,7 @@ $ENV{TZ} = 'UTC'; $ENV{LC_ALL} = 'C'; $| = 1; # unbuffer STDOUT +sub fatal (@) { print STDERR $@; exit 1 } # If SVN:: library support is added, please make the dependencies # optional and preserve the capability to use the command-line client. # use eval { require SVN::... } to make it lazy load @@ -571,7 +572,7 @@ sub commit_lib { $no = 1; } } - close $fh or croak $?; + close $fh or exit 1; if (! defined $r_new && ! defined $cmt_new) { unless ($no) { die "Failed to parse revision information\n"; @@ -873,13 +874,16 @@ sub commit_diff { print "Committed $_[0]\n"; }, @lock) ); - my $mods = libsvn_checkout_tree($ta, $tb, $ed); - if (@$mods == 0) { - print "No changes\n$ta == $tb\n"; - $ed->abort_edit; - } else { - $ed->close_edit; - } + eval { + my $mods = libsvn_checkout_tree($ta, $tb, $ed); + if (@$mods == 0) { + print "No changes\n$ta == $tb\n"; + $ed->abort_edit; + } else { + $ed->close_edit; + } + }; + fatal "$@\n" if $@; $_message = $_file = undef; return $rev_committed; } From 155bd0ce23144e5c7067965a22646523f1a38b51 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 12 Dec 2006 14:47:02 -0800 Subject: [PATCH 4/5] git-svn: correctly display fatal() error messages If I wanted to print $@, I'd pass $@ to fatal(). This looks like a stupid typo on my part. Signed-off-by: Eric Wong Signed-off-by: Junio C Hamano --- git-svn.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-svn.perl b/git-svn.perl index e8b5c0966b..599edc3dd5 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -21,7 +21,7 @@ $ENV{TZ} = 'UTC'; $ENV{LC_ALL} = 'C'; $| = 1; # unbuffer STDOUT -sub fatal (@) { print STDERR $@; exit 1 } +sub fatal (@) { print STDERR @_; exit 1 } # If SVN:: library support is added, please make the dependencies # optional and preserve the capability to use the command-line client. # use eval { require SVN::... } to make it lazy load From f2dd1c9adfe961ea611545b018bc67e5d83ee3db Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 13 Dec 2006 01:33:43 -0800 Subject: [PATCH 5/5] Revert "git-diff: Introduce --index and deprecate --cached." This reverts commit 4c81c213a479e4aae0653a56ad6e8db5c31f019c. Although --cached and --index are confusing wording, the use of word --cached for git-diff is consistent with git-apply. It means "work with index without looking at the working tree". We should probably come up with better wording for --cached, if somebody wants to deprecate it. But making --index and --cached synonyms for diff while leaving them mean different things for apply is no good. --- Documentation/git-diff.txt | 6 ++---- builtin-diff.c | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Documentation/git-diff.txt b/Documentation/git-diff.txt index 3144864d85..228c4d95bd 100644 --- a/Documentation/git-diff.txt +++ b/Documentation/git-diff.txt @@ -22,10 +22,8 @@ the number of trees given to the command. * When one is given, the working tree and the named tree are compared, using `git-diff-index`. The option - `--index` can be given to compare the index file and + `--cached` can be given to compare the index file and the named tree. - `--cached` is a deprecated alias for `--index`. It's use is - discouraged. * When two s are given, these two trees are compared using `git-diff-tree`. @@ -49,7 +47,7 @@ Various ways to check your working tree:: + ------------ $ git diff <1> -$ git diff --index <2> +$ git diff --cached <2> $ git diff HEAD <3> ------------ + diff --git a/builtin-diff.c b/builtin-diff.c index 1c535b1dd6..a6590205e8 100644 --- a/builtin-diff.c +++ b/builtin-diff.c @@ -137,7 +137,7 @@ static int builtin_diff_index(struct rev_info *revs, int cached = 0; while (1 < argc) { const char *arg = argv[1]; - if (!strcmp(arg, "--index") || !strcmp(arg, "--cached")) + if (!strcmp(arg, "--cached")) cached = 1; else usage(builtin_diff_usage);