From e7af8e49cd54f1784fa2a0e382f22ca2f98cf4d8 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 30 May 2011 10:19:05 -0400 Subject: [PATCH 1/5] format-patch: make zero-length subject prefixes prettier If you give a zero-length subject prefix to format-patch (e.g., "format-patch --subject-prefix="), we will print the ugly: Subject: [ 1/2] your subject here because we always insert a space between the prefix and numbering. Requiring the user to provide the space in their prefix would be more flexible, but would break existing usage. This patch provides a DWIM and suppresses the space for zero-length prefixes, under the assumption that nobody actually wants "[ 1/2]". Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- log-tree.c | 3 ++- t/t4014-format-patch.sh | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/log-tree.c b/log-tree.c index 2a1e3a94c9..296f417dfc 100644 --- a/log-tree.c +++ b/log-tree.c @@ -294,8 +294,9 @@ void log_write_email_headers(struct rev_info *opt, struct commit *commit, if (opt->total > 0) { static char buffer[64]; snprintf(buffer, sizeof(buffer), - "Subject: [%s %0*d/%d] ", + "Subject: [%s%s%0*d/%d] ", opt->subject_prefix, + *opt->subject_prefix ? " " : "", digits_in_number(opt->total), opt->nr, opt->total); subject = buffer; diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index 045cee312c..92248d24c4 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -851,4 +851,22 @@ test_expect_success 'subject lines do not have 822 atom-quoting' ' test_cmp expect actual ' +cat >expect <<'EOF' +Subject: [PREFIX 1/1] header with . in it +EOF +test_expect_success 'subject prefixes have space prepended' ' + git format-patch -n -1 --stdout --subject-prefix=PREFIX >patch && + grep ^Subject: patch >actual && + test_cmp expect actual +' + +cat >expect <<'EOF' +Subject: [1/1] header with . in it +EOF +test_expect_success 'empty subject prefix does not have extra space' ' + git format-patch -n -1 --stdout --subject-prefix= >patch && + grep ^Subject: patch >actual && + test_cmp expect actual +' + test_done From 8e4414edde857a90ce90bb542811f1c22071f16f Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Mon, 30 May 2011 10:52:56 -0500 Subject: [PATCH 2/5] Documentation: do not misinterpret refspecs as bold text In v1.7.3.3~2 (Documentation: do not misinterpret pull refspec as bold text, 2010-12-03) many uses of asterisks in expressions like "refs/heads/*:refs/svn/origin/branches/*" were escaped as {asterisk} to avoid being treated as delimiters for bold text, but these two were missed. Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- Documentation/git-remote-helpers.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/git-remote-helpers.txt b/Documentation/git-remote-helpers.txt index 87cd11f2c4..58f6ad4994 100644 --- a/Documentation/git-remote-helpers.txt +++ b/Documentation/git-remote-helpers.txt @@ -181,11 +181,11 @@ CAPABILITIES When using the import command, expect the source ref to have been written to the destination ref. The earliest applicable refspec takes precedence. For example - "refs/heads/*:refs/svn/origin/branches/*" means that, after an - "import refs/heads/name", the script has written to + "refs/heads/{asterisk}:refs/svn/origin/branches/{asterisk}" means + that, after an "import refs/heads/name", the script has written to refs/svn/origin/branches/name. If this capability is used at all, it must cover all refs reported by the list command; if - it is not used, it is effectively "*:*" + it is not used, it is effectively "{asterisk}:{asterisk}" REF LIST ATTRIBUTES ------------------- From 766d6268c6af14970744f69c574e4b34ec056106 Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Tue, 31 May 2011 18:23:42 +0100 Subject: [PATCH 3/5] config.c: Remove unused git_config_global() function Commit 8f323c00 (drop support for GIT_CONFIG_NOGLOBAL, 15-03-2011) removed the git_config_global() function, among other things, since it is no longer required. Unfortunately, this function has since been unintentionally restored by a faulty conflict resolution. Remove it. Signed-off-by: Ramsay Jones Signed-off-by: Junio C Hamano --- config.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config.c b/config.c index a8267e9265..e0b3b80d92 100644 --- a/config.c +++ b/config.c @@ -825,11 +825,6 @@ int git_config_system(void) return !git_env_bool("GIT_CONFIG_NOSYSTEM", 0); } -int git_config_global(void) -{ - return !git_env_bool("GIT_CONFIG_NOGLOBAL", 0); -} - int git_config_early(config_fn_t fn, void *data, const char *repo_config) { int ret = 0, found = 0; From 2b0b64ee850e72b9a88c821c418b1620fccf2092 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 31 May 2011 12:06:40 -0700 Subject: [PATCH 4/5] Start 1.7.5.4 draft release notes Signed-off-by: Junio C Hamano --- Documentation/RelNotes/1.7.5.4.txt | 18 ++++++++++++++++++ RelNotes | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 Documentation/RelNotes/1.7.5.4.txt diff --git a/Documentation/RelNotes/1.7.5.4.txt b/Documentation/RelNotes/1.7.5.4.txt new file mode 100644 index 0000000000..f3412ced33 --- /dev/null +++ b/Documentation/RelNotes/1.7.5.4.txt @@ -0,0 +1,18 @@ +Git v1.7.5.4 Release Notes +========================== + +Fixes since v1.7.5.3 +-------------------- + + * The single-key mode of "git add -p" was easily fooled into thinking + that it was told to add everthing ('a') when up-arrow was pressed by + mistake. + + * "git diff -C -C" used to disable the rename detection entirely when + there are too many copy candidate paths in the tree; now it falls + back to "-C" when doing so would keep the copy candidate paths + under the rename detection limit. + + * "git rerere" did not diagnose a corrupt MERGE_RR file in some cases. + +And other minor fixes and documentation updates. diff --git a/RelNotes b/RelNotes index bb805da971..313a3c0290 120000 --- a/RelNotes +++ b/RelNotes @@ -1 +1 @@ -Documentation/RelNotes/1.7.5.3.txt \ No newline at end of file +Documentation/RelNotes/1.7.5.4.txt \ No newline at end of file From 090a1a5d95c7b4380e6a52f42add41ead9215ed3 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 31 May 2011 12:22:50 -0700 Subject: [PATCH 5/5] Update draft release notes to 1.7.6 I think we are almost there for the feature freeze. Signed-off-by: Junio C Hamano --- Documentation/RelNotes/1.7.6.txt | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Documentation/RelNotes/1.7.6.txt b/Documentation/RelNotes/1.7.6.txt index 7e1c7f1773..6ab3252888 100644 --- a/Documentation/RelNotes/1.7.6.txt +++ b/Documentation/RelNotes/1.7.6.txt @@ -53,11 +53,6 @@ Updates since v1.7.5 * "git commit" learned a "--patch" option to directly jump to the per-hunk selection UI of the interactive mode. - * "git diff -C -C" used to disable the rename detection entirely when - there are too many copy candidate paths in the tree; now it falls - back to "-C" when doing so would keep the copy candidate paths - under the rename detection limit. - * "git diff" and its family of commands learned --dirstat=0 to show directories that contribute less than 0.1% of changes. @@ -72,6 +67,8 @@ Updates since v1.7.5 characters in it, e.g. "Junio C. Hamano" . Earlier it was up to the user to do this when using its output. + * "git format-patch" can take an empty --subject-prefix now. + * "git log" and friends learned a new "--notes" option to replace the "--show-notes" option. Unlike "--show-notes", "--notes=" does not imply showing the default notes. @@ -93,9 +90,20 @@ Updates since v1.7.5 * p4-import (from contrib) learned a new option --preserve-user. + * "git read-tree -m" learned "--dry-run" option that reports if a merge + would fail without touching the index nor the working tree. + * "git rebase" that does not specify on top of which branch to rebase the current branch now uses @{upstream} of the current branch. + * "git rebase" finished either normally or with --abort did not + update the reflog for HEAD to record the event to come back to + where it started from. + + * "git remote add -t only-this-branch --mirror=fetch" is now allowed. Earlier + a fetch-mode mirror meant mirror everything, but now it only means refs are + not renamed. + * "git rev-list --count" used with "--cherry-mark" counts the cherry-picked commits separately, producing more a useful output. @@ -116,11 +124,6 @@ Fixes since v1.7.5 Unless otherwise noted, all the fixes in 1.7.5.X maintenance track are included in this release. - * The single-key mode of "git add -p" was easily fooled into thinking - that it was told to add everthing ('a') when up-arrow was pressed by - mistake. - (merge tr/add-i-no-escape later) - * "git config" used to choke with an insanely long line. (merge ef/maint-strbuf-init later)