From 0d12e59f636b68964c80a82a58020d34a6cd5032 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Wed, 17 Mar 2010 22:10:45 -0700 Subject: [PATCH 1/7] pull: replace unnecessary sed invocation Getting the shortened branch name is as easy as using the shell's parameter expansion. Signed-off-by: Stephen Boyd Signed-off-by: Junio C Hamano --- git-pull.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-pull.sh b/git-pull.sh index 38331a8611..246a3a4b37 100755 --- a/git-pull.sh +++ b/git-pull.sh @@ -41,7 +41,7 @@ strategy_args= diffstat= no_commit= squash= no_ff= ff_only= log_arg= verbosity= merge_args= curr_branch=$(git symbolic-ref -q HEAD) -curr_branch_short=$(echo "$curr_branch" | sed "s|refs/heads/||") +curr_branch_short="${curr_branch#refs/heads/}" rebase=$(git config --bool branch.$curr_branch_short.rebase) while : do From c40d92e4c73b44d9cb4c3ba3a0ab53464964369c Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Fri, 19 Mar 2010 19:06:15 -0500 Subject: [PATCH 2/7] Makefile: Fix CDPATH problem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If CDPATH is set, "cd" prints its destination to stdout, causing the common (cd a && tar cf - .) | (cd b && tar xf -) idiom to fail. For example: make -C templates DESTDIR='' install make[1]: Entering directory `/users/e477610/exptool/src/git-1.7.0.2/templates' install -d -m 755 '/home/e477610/exptool/share/git-core/templates' (cd blt && gtar cf - .) | \ (cd '/home/e477610/exptool/share/git-core/templates' && umask 022 && gtar xof -) gtar: This does not look like a tar archive Most git scripts already protect against use of CDPATH through git-sh-setup, but the Makefile doesn’t. Reported-by: Michael Cox Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 4387d4207f..98372ebbfc 100644 --- a/Makefile +++ b/Makefile @@ -317,6 +317,12 @@ SCRIPT_PYTHON = SCRIPT_SH = TEST_PROGRAMS = +# Having this variable in your environment would break pipelines because +# you cause "cd" to echo its destination to stdout. It can also take +# scripts to unexpected places. If you like CDPATH, define it for your +# interactive shell sessions without exporting it. +unexport CDPATH + SCRIPT_SH += git-am.sh SCRIPT_SH += git-bisect.sh SCRIPT_SH += git-difftool--helper.sh From e9bd32351078d1f664a1608763a92ab402b255f0 Mon Sep 17 00:00:00 2001 From: Imre Deak Date: Sat, 20 Mar 2010 04:23:58 +0200 Subject: [PATCH 3/7] daemon: parse_host_and_port SIGSEGV if port is specified This typo will lead to git-daemon dying any time the connect string includes a port after the host= attribute. This can lead for example to one of the following error messages on the client side when someone tries git clone git://...:. When the daemon is running on localhost: fatal: The remote end hung up unexpectedly or when the daemon is connected through an ssh tunnel: fatal: protocol error: bad line length character: erro In the latter case 'erro' comes from the daemon's reply: error: git-daemon died of signal 11 Signed-off-by: Imre Deak Signed-off-by: Junio C Hamano --- daemon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon.c b/daemon.c index 3769b6f570..7d9e1c03e8 100644 --- a/daemon.c +++ b/daemon.c @@ -420,7 +420,7 @@ static void parse_host_and_port(char *hostport, char **host, *host = hostport; *port = strrchr(hostport, ':'); if (*port) { - *port = '\0'; + **port = '\0'; ++*port; } } From aac1d7b88918f39b1b7c5bc0dcf831dcc9d5d8a8 Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Sat, 13 Mar 2010 18:17:04 +0100 Subject: [PATCH 4/7] fetch: Check for a "^{}" suffix with suffixcmp() Otherwise, we will check random bytes for ref names < 3 characters. Signed-off-by: Andreas Gruenbacher Signed-off-by: Junio C Hamano --- builtin-fetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin-fetch.c b/builtin-fetch.c index b059d652c6..0acf80991b 100644 --- a/builtin-fetch.c +++ b/builtin-fetch.c @@ -588,7 +588,7 @@ static void find_non_local_tags(struct transport *transport, * to fetch then we can mark the ref entry in the list * as one to ignore by setting util to NULL. */ - if (!strcmp(ref->name + strlen(ref->name) - 3, "^{}")) { + if (!suffixcmp(ref->name, "^{}")) { if (item && !has_sha1_file(ref->old_sha1) && !will_fetch(head, ref->old_sha1) && !has_sha1_file(item->util) && From 8da61a2ab48175526390233c8bcedf63a3cdb6c4 Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Fri, 12 Mar 2010 23:27:33 +0100 Subject: [PATCH 5/7] fetch: Future-proof initialization of a refspec on stack The open-coded version to initialize each and every member will break when a new member is added to the structure. Signed-off-by: Andreas Gruenbacher Signed-off-by: Junio C Hamano --- builtin-fetch.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/builtin-fetch.c b/builtin-fetch.c index 0acf80991b..8dd1adf849 100644 --- a/builtin-fetch.c +++ b/builtin-fetch.c @@ -104,10 +104,8 @@ static void add_merge_config(struct ref **head, * there is no entry in the resulting FETCH_HEAD marked * for merging. */ + memset(&refspec, 0, sizeof(refspec)); refspec.src = branch->merge[i]->src; - refspec.dst = NULL; - refspec.pattern = 0; - refspec.force = 0; get_fetch_map(remote_refs, &refspec, tail, 1); for (rm = *old_tail; rm; rm = rm->next) rm->merge = 1; From 730b02003070400a82ff89b240573765d71e839a Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Mon, 15 Mar 2010 23:18:48 +0100 Subject: [PATCH 6/7] fetch: Fix minor memory leak A temporary struct ref is allocated in store_updated_refs() but not freed. Signed-off-by: Andreas Gruenbacher Signed-off-by: Junio C Hamano --- builtin-fetch.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/builtin-fetch.c b/builtin-fetch.c index 8dd1adf849..bbc425b655 100644 --- a/builtin-fetch.c +++ b/builtin-fetch.c @@ -387,9 +387,10 @@ static int store_updated_refs(const char *raw_url, const char *remote_name, fputc(url[i], fp); fputc('\n', fp); - if (ref) + if (ref) { rc |= update_local_ref(ref, what, note); - else + free(ref); + } else sprintf(note, "* %-*s %-*s -> FETCH_HEAD", SUMMARY_WIDTH, *kind ? kind : "branch", REFCOL_WIDTH, *what ? what : "HEAD"); From 8fe5d87622a4268079bf1e5738474f85d4e5c3bc Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 20 Mar 2010 11:29:13 -0700 Subject: [PATCH 7/7] Update draft release notes to 1.7.0.3 Signed-off-by: Junio C Hamano --- Documentation/RelNotes-1.7.0.3.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/RelNotes-1.7.0.3.txt b/Documentation/RelNotes-1.7.0.3.txt index ed936385a5..60bcbff112 100644 --- a/Documentation/RelNotes-1.7.0.3.txt +++ b/Documentation/RelNotes-1.7.0.3.txt @@ -9,6 +9,9 @@ Fixes since v1.7.0.2 * "git add -i" didn't handle a deleted path very well. + * "git blame" padded line numbers with one extra SP when the total number + of lines was one less than multiple of ten due to an off-by-one error. + * "git fetch --all/--multi" used to discard information for remotes that are fetched earlier. @@ -16,6 +19,9 @@ Fixes since v1.7.0.2 or are written by "me", instead of the ones that have "it" _and_ are written by "me". + * "git log -g branch" misbehaved when there was no entries in the reflog + for the named branch. + * "git mailinfo" (hence "git am") incorrectly removed initial indent from paragraphs. @@ -30,5 +36,5 @@ And other minor fixes and documentation updates. -- exec >/var/tmp/1 echo O=$(git describe) -O=v1.7.0.2-53-g6eb3adf +O=v1.7.0.2-69-g730b020 git shortlog --no-merges $O..