From 5126f35a54f179d125775e6d18213f76aa7856b3 Mon Sep 17 00:00:00 2001 From: Martin Waitz Date: Mon, 22 May 2006 12:09:14 +0200 Subject: [PATCH 1/9] git help: remove whatchanged from list of common commands whatchanged is replaced by git log now. Signed-off-by: Martin Waitz Signed-off-by: Junio C Hamano --- generate-cmdlist.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh index 6c59dbd68f..ec1eda20de 100755 --- a/generate-cmdlist.sh +++ b/generate-cmdlist.sh @@ -37,7 +37,6 @@ show-branch status tag verify-tag -whatchanged EOF while read cmd do From 884e3134a0002af1f8842768873fe9d041ed9a76 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 22 May 2006 15:34:40 -0700 Subject: [PATCH 2/9] Tutorial #2: broken link fix. Signed-off-by: Junio C Hamano --- Documentation/tutorial-2.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/tutorial-2.txt b/Documentation/tutorial-2.txt index 7de91aa735..08d3453e5c 100644 --- a/Documentation/tutorial-2.txt +++ b/Documentation/tutorial-2.txt @@ -375,7 +375,7 @@ What next? At this point you should know everything necessary to read the man pages for any of the git commands; one good place to start would be -with the commands mentioned in link:everday.html[Everyday git]. You +with the commands mentioned in link:everyday.html[Everyday git]. You should be able to find any unknown jargon in the link:glossary.html[Glosssay]. From e3008464e70d25b4926b97b1f86951d7a3cb938d Mon Sep 17 00:00:00 2001 From: Sean Date: Mon, 22 May 2006 20:36:34 -0400 Subject: [PATCH 3/9] Avoid segfault in diff --stat rename output. Signed-off-by: Sean Estabrooks Signed-off-by: Junio C Hamano --- diff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diff.c b/diff.c index 1601783679..3a2a175c7e 100644 --- a/diff.c +++ b/diff.c @@ -237,7 +237,7 @@ static char *pprint_rename(const char *a, const char *b) if (a_midlen < 0) a_midlen = 0; if (b_midlen < 0) b_midlen = 0; - name = xmalloc(len_a + len_b - pfx_length - sfx_length + 7); + name = xmalloc(pfx_length + a_midlen + b_midlen + sfx_length + 7); sprintf(name, "%.*s{%.*s => %.*s}%s", pfx_length, a, a_midlen, a + pfx_length, From f803eec51b6fe812c523c8f6474e029163b307e8 Mon Sep 17 00:00:00 2001 From: Yakov Lerner Date: Mon, 22 May 2006 22:34:00 +0300 Subject: [PATCH 4/9] Problem: 'trap...exit' causes error message when /bin/sh is ash. Problem: 'trap...exit' causes error message when /bin/sh is ash. Fix: Change 'trap...exit' to 'trap...0' like in other scripts. Signed-off-by: Yakov Lerner Signed-off-by: Junio C Hamano --- git-clone.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-clone.sh b/git-clone.sh index 227245c865..d96894d4c2 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -199,7 +199,7 @@ dir="$2" [ -e "$dir" ] && echo "$dir already exists." && usage mkdir -p "$dir" && D=$(cd "$dir" && pwd) && -trap 'err=$?; cd ..; rm -r "$D"; exit $err' exit +trap 'err=$?; cd ..; rm -r "$D"; exit $err' 0 case "$bare" in yes) GIT_DIR="$D" ;; *) GIT_DIR="$D/.git" ;; @@ -407,5 +407,5 @@ Pull: refs/heads/$head_points_at:$origin_track" && fi rm -f "$GIT_DIR/CLONE_HEAD" "$GIT_DIR/REMOTE_HEAD" -trap - exit +trap - 0 From f396f01f11208789875b61e4e0e3239b04f9e38d Mon Sep 17 00:00:00 2001 From: Martin Langhoff Date: Tue, 23 May 2006 00:45:47 +1200 Subject: [PATCH 5/9] cvsimport: minor fixups Cleanup @skipped after it's used. Close a fhandle. Removing suspects one at a time. Signed-off-by: Martin Langhoff Signed-off-by: Junio C Hamano --- git-cvsimport.perl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/git-cvsimport.perl b/git-cvsimport.perl index 8c707f2c66..282646af35 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -650,6 +650,8 @@ my $commit = sub { "GIT_COMMITTER_DATE=".strftime("+0000 %Y-%m-%d %H:%M:%S",gmtime($date)), "git-commit-tree", $tree,@par); die "Cannot exec git-commit-tree: $!\n"; + + close OUT; } $pw->writer(); $pr->reader(); @@ -661,6 +663,7 @@ my $commit = sub { if (@skipped) { $logmsg .= "\n\n\nSKIPPED:\n\t"; $logmsg .= join("\n\t", @skipped) . "\n"; + @skipped = (); } print $pw "$logmsg\n" From c4b16f8d7786c2a9655636779ce4e3e89f0df86c Mon Sep 17 00:00:00 2001 From: Martin Langhoff Date: Tue, 23 May 2006 00:45:39 +1200 Subject: [PATCH 6/9] cvsimport: replace anonymous sub ref with a normal sub commit() does not need to be an anonymous subreference. Keep it simple. Signed-off-by: Martin Langhoff Signed-off-by: Junio C Hamano --- git-cvsimport.perl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git-cvsimport.perl b/git-cvsimport.perl index 282646af35..d257e668d6 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -563,7 +563,7 @@ my $state = 0; my($patchset,$date,$author_name,$author_email,$branch,$ancestor,$tag,$logmsg); my(@old,@new,@skipped); -my $commit = sub { +sub commit { my $pid; while(@old) { my @o2; @@ -852,7 +852,7 @@ while() { } elsif($state == 9 and /^\s*$/) { $state = 10; } elsif(($state == 9 or $state == 10) and /^-+$/) { - &$commit(); + commit(); $state = 1; } elsif($state == 11 and /^-+$/) { $state = 1; @@ -862,7 +862,7 @@ while() { print "* UNKNOWN LINE * $_\n"; } } -&$commit() if $branch and $state != 11; +commit() if $branch and $state != 11; unlink($git_index); From 1100ac81a90b03e0c037a286569a340decf7489b Mon Sep 17 00:00:00 2001 From: Sean Date: Mon, 22 May 2006 00:39:52 -0400 Subject: [PATCH 7/9] Change GIT-VERSION-GEN to call git commands with "git" not "git-". GIT-VERSION-GEN can incorrectly return a default version of "v1.3.GIT" because it tries to execute git commands using the "git-cmd" format that expects all git commands to be in the $PATH. Convert these to "git cmd" format so that a proper answer is returned even when the git commands have been moved out of the $PATH and into a $gitexecdir. Signed-off-by: Junio C Hamano --- GIT-VERSION-GEN | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 7fcefcd7c4..a461518cde 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -5,7 +5,7 @@ DEF_VER=v1.3.GIT # First try git-describe, then see if there is a version file # (included in release tarballs), then default -if VN=$(git-describe --abbrev=4 HEAD 2>/dev/null); then +if VN=$(git describe --abbrev=4 HEAD 2>/dev/null); then VN=$(echo "$VN" | sed -e 's/-/./g'); elif test -f version then @@ -16,7 +16,7 @@ fi VN=$(expr "$VN" : v*'\(.*\)') -dirty=$(sh -c 'git-diff-index --name-only HEAD' 2>/dev/null) || dirty= +dirty=$(sh -c 'git diff-index --name-only HEAD' 2>/dev/null) || dirty= case "$dirty" in '') ;; From 7f7e6eacf999cb53771426e561589f721e6c9974 Mon Sep 17 00:00:00 2001 From: Sean Date: Mon, 22 May 2006 00:42:59 -0400 Subject: [PATCH 8/9] Install git builtins into gitexecdir rather than bindir. Moving "git-cmd" commands out of the path and into a special git exec path, should include the builtins. [jc: fixed the case where bindir == gitexecdir - ln -f fails with a complaint that src and dst are the same, likewise for the fallback cp.] Signed-off-by: Junio C Hamano --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index efe6b12719..5423b7a79b 100644 --- a/Makefile +++ b/Makefile @@ -627,7 +627,14 @@ install: all $(MAKE) -C templates install $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(GIT_PYTHON_DIR_SQ)' $(INSTALL) $(PYMODULES) '$(DESTDIR_SQ)$(GIT_PYTHON_DIR_SQ)' - $(foreach p,$(BUILT_INS), rm -f '$(DESTDIR_SQ)$(bindir_SQ)/$p' && ln '$(DESTDIR_SQ)$(bindir_SQ)/git$X' '$(DESTDIR_SQ)$(bindir_SQ)/$p' ;) + if test 'z$(bindir_SQ)' != 'z$(gitexecdir_SQ)'; \ + then \ + ln -f '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \ + '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' || \ + cp '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \ + '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X'; \ + fi + $(foreach p,$(BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;) install-doc: $(MAKE) -C Documentation install From 07001f95a60149619bed62af7ad59052ace7ac92 Mon Sep 17 00:00:00 2001 From: Sean Date: Sat, 20 May 2006 18:46:33 -0400 Subject: [PATCH 9/9] Remove possible segfault in http-fetch. Free the curl string lists after running http_cleanup to avoid an occasional segfault in the curl library. Seems to only occur if the website returns a 405 error. Signed-off-by: Sean Estabrooks Signed-off-by: Junio C Hamano --- http-fetch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http-fetch.c b/http-fetch.c index 861644b27e..178f1ee311 100644 --- a/http-fetch.c +++ b/http-fetch.c @@ -1269,10 +1269,10 @@ int main(int argc, char **argv) if (pull(commit_id)) rc = 1; - curl_slist_free_all(no_pragma_header); - http_cleanup(); + curl_slist_free_all(no_pragma_header); + if (corrupt_object_found) { fprintf(stderr, "Some loose object were found to be corrupt, but they might be just\n"