From 14df4c41885ea19c9ce263111c6de994a4028601 Mon Sep 17 00:00:00 2001 From: Jim Radford Date: Thu, 10 Nov 2005 11:03:08 -0800 Subject: Add missing git-core and cvsps RPM dependencies. Signed-off-by: Jim Radford Signed-off-by: Junio C Hamano diff --git a/git-core.spec.in b/git-core.spec.in index 26846d0..ce9acd8 100644 --- a/git-core.spec.in +++ b/git-core.spec.in @@ -22,20 +22,21 @@ elsewhere for tools for ordinary humans layered on top of this. %package svn Summary: Git tools for importing Subversion repositories. Group: Development/Tools -Requires: subversion +Requires: git-core, subversion %description svn Git tools for importing Subversion repositories. %package cvs Summary: Git tools for importing CVS repositories. Group: Development/Tools -Requires: cvs +Requires: git-core, cvs, cvsps %description cvs Git tools for importing CVS repositories. %package email Summary: Git tools for sending email. Group: Development/Tools +Requires: git-core %description email Git tools for sending email. -- cgit v0.10.2-6-g49f6 From ad7db62113368279a1b6994790bf30925fabea33 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Thu, 10 Nov 2005 20:55:13 +0100 Subject: Fix confusing git-update-ref error message When git-update-ref has hit the "Ref %s changed to %s" error, I just stare at it, left puzzled. This patch attempts to reword that to a more useful and less confusing error message. Signed-off-by: Petr Baudis Signed-off-by: Junio C Hamano diff --git a/update-ref.c b/update-ref.c index 65dc3d6..d79dc52 100644 --- a/update-ref.c +++ b/update-ref.c @@ -42,7 +42,7 @@ int main(int argc, char **argv) if (oldval) { if (memcmp(currsha1, oldsha1, 20)) - die("Ref %s changed to %s", refname, sha1_to_hex(currsha1)); + die("Ref %s is at %s but expected %s", refname, sha1_to_hex(currsha1), sha1_to_hex(oldsha1)); /* Nothing to do? */ if (!memcmp(oldsha1, sha1, 20)) exit(0); -- cgit v0.10.2-6-g49f6 From 66c9ec25553ce7332c46e2017b9c4d7c26310fff Mon Sep 17 00:00:00 2001 From: Josef Weidendorfer Date: Thu, 10 Nov 2005 14:12:19 +0100 Subject: Let git-clone/git-fetch follow HTTP redirections Otherwise, git-clone silently failed to clone a remote repository where redirections (ie. a response with a "Location" header line) are used. This includes the fixes from Nick Hengeveld. Signed-off-by: Josef Weidendorfer Signed-off-by: Junio C Hamano diff --git a/git-clone.sh b/git-clone.sh index 4fdd652..aafcc18 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -23,7 +23,7 @@ fi http_fetch () { # $1 = Remote, $2 = Local - curl -nsf $curl_extra_args "$1" >"$2" + curl -nsfL $curl_extra_args "$1" >"$2" } clone_dumb_http () { diff --git a/git-fetch.sh b/git-fetch.sh index 31e5f4c..8564cbf 100755 --- a/git-fetch.sh +++ b/git-fetch.sh @@ -230,7 +230,7 @@ do $u =~ s{([^-a-zA-Z0-9/.])}{sprintf"%%%02x",ord($1)}eg; print "$u"; ' "$remote_name") - head=$(curl -nsf $curl_extra_args "$remote/$remote_name_quoted") && + head=$(curl -nsfL $curl_extra_args "$remote/$remote_name_quoted") && expr "$head" : "$_x40\$" >/dev/null || die "Failed to fetch $remote_name from $remote" echo >&2 Fetching "$remote_name from $remote" using http diff --git a/http-fetch.c b/http-fetch.c index 88b74b4..99921cc 100644 --- a/http-fetch.c +++ b/http-fetch.c @@ -269,6 +269,8 @@ static CURL* get_curl_handle(void) curl_low_speed_time); } + curl_easy_setopt(result, CURLOPT_FOLLOWLOCATION, 1); + return result; } -- cgit v0.10.2-6-g49f6 From 605607cc622478fb2e8dfcab2ff16f54b0995599 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 10 Nov 2005 17:46:20 -0800 Subject: Documentation: "host:path/to/repo" is git native over ssh. You could also spell it ssh://host:/path/to/repo (or git+ssh, ssh+git), but without method:// is shorter to type, so mention only that one in the short and sweet list. Noticed by Pasky. Signed-off-by: Junio C Hamano diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt index 5c2888e..ddd5823 100644 --- a/Documentation/pull-fetch-param.txt +++ b/Documentation/pull-fetch-param.txt @@ -8,7 +8,7 @@ - Rsync URL: rsync://remote.machine/path/to/repo.git/ - HTTP(s) URL: http://remote.machine/path/to/repo.git/ - git URL: git://remote.machine/path/to/repo.git/ - or remote.machine:/path/to/repo.git/ +- ssh URL: remote.machine:/path/to/repo.git/ - Local directory: /path/to/repo.git/ =============================================================== + -- cgit v0.10.2-6-g49f6 From e3e291fc07b49b74bb655ca854bdb19e849e044c Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 10 Nov 2005 23:34:08 -0800 Subject: Do not lose author name information to locale gotchas. I noticed format-patch loses authorship information of Lukas' patch when I run git tools with LC_LANG set to ja_JP. It turns out that the sed script to set environment variables were not working on his name (encoded in UTF-8), which is unfortunate but technically correct. Force sed invocation under C locale because we always want literal byte semantics. Signed-off-by: Junio C Hamano diff --git a/git-commit.sh b/git-commit.sh index daf90f1..41955e8 100755 --- a/git-commit.sh +++ b/git-commit.sh @@ -184,7 +184,7 @@ then } ' set_author_env=`git-cat-file commit "$use_commit" | - sed -ne "$pick_author_script"` + LANG=C LC_ALL=C sed -ne "$pick_author_script"` eval "$set_author_env" export GIT_AUTHOR_NAME export GIT_AUTHOR_EMAIL diff --git a/git-format-patch.sh b/git-format-patch.sh index 548d2d5..7ee5d32 100755 --- a/git-format-patch.sh +++ b/git-format-patch.sh @@ -201,7 +201,7 @@ process_one () { ;; esac - eval "$(sed -ne "$whosepatchScript" $commsg)" + eval "$(LANG=C LC_ALL=C sed -ne "$whosepatchScript" $commsg)" test "$author,$au" = ",$me" || { mailScript="$mailScript"' a\ diff --git a/git-revert.sh b/git-revert.sh index dfd914c..4154fe0 100755 --- a/git-revert.sh +++ b/git-revert.sh @@ -112,7 +112,7 @@ cherry-pick) q }' set_author_env=`git-cat-file commit "$commit" | - sed -ne "$pick_author_script"` + LANG=C LC_ALL=C sed -ne "$pick_author_script"` eval "$set_author_env" export GIT_AUTHOR_NAME export GIT_AUTHOR_EMAIL -- cgit v0.10.2-6-g49f6 From ff56fe1ca7f43087fd84588af87179c2959d0cb3 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 9 Nov 2005 22:15:27 -0800 Subject: Add --pretty=fuller git log without --pretty showed author and author-date, while with --pretty=full showed author and committer but no dates. The new formatting option, --pretty=fuller, shows both name and timestamp for author and committer. Signed-off-by: Junio C Hamano diff --git a/commit.c b/commit.c index a8c9bfc..534c03e 100644 --- a/commit.c +++ b/commit.c @@ -34,6 +34,8 @@ enum cmit_fmt get_commit_format(const char *arg) return CMIT_FMT_SHORT; if (!strcmp(arg, "=full")) return CMIT_FMT_FULL; + if (!strcmp(arg, "=fuller")) + return CMIT_FMT_FULLER; if (!strcmp(arg, "=oneline")) return CMIT_FMT_ONELINE; die("invalid --pretty format"); @@ -361,6 +363,7 @@ static int add_user_info(const char *what, enum cmit_fmt fmt, char *buf, const c int namelen; unsigned long time; int tz, ret; + const char *filler = " "; if (fmt == CMIT_FMT_ONELINE) return 0; @@ -371,9 +374,20 @@ static int add_user_info(const char *what, enum cmit_fmt fmt, char *buf, const c time = strtoul(date, &date, 10); tz = strtol(date, NULL, 10); - ret = sprintf(buf, "%s: %.*s\n", what, namelen, line); - if (fmt == CMIT_FMT_MEDIUM) + ret = sprintf(buf, "%s: %.*s%.*s\n", what, + (fmt == CMIT_FMT_FULLER) ? 4 : 0, + filler, namelen, line); + switch (fmt) { + case CMIT_FMT_MEDIUM: ret += sprintf(buf + ret, "Date: %s\n", show_date(time, tz)); + break; + case CMIT_FMT_FULLER: + ret += sprintf(buf + ret, "%sDate: %s\n", what, show_date(time, tz)); + break; + default: + /* notin' */ + break; + } return ret; } @@ -448,12 +462,21 @@ unsigned long pretty_print_commit(enum cmit_fmt fmt, const char *msg, unsigned l die("bad parent line in commit"); offset += add_parent_info(fmt, buf + offset, line, ++parents); } + + /* + * MEDIUM == DEFAULT shows only author with dates. + * FULL shows both authors but not dates. + * FULLER shows both authors and dates. + */ if (!memcmp(line, "author ", 7)) - offset += add_user_info("Author", fmt, buf + offset, line + 7); - if (fmt == CMIT_FMT_FULL) { - if (!memcmp(line, "committer ", 10)) - offset += add_user_info("Commit", fmt, buf + offset, line + 10); - } + offset += add_user_info("Author", fmt, + buf + offset, + line + 7); + if (!memcmp(line, "committer ", 10) && + (fmt == CMIT_FMT_FULL || fmt == CMIT_FMT_FULLER)) + offset += add_user_info("Commit", fmt, + buf + offset, + line + 10); continue; } diff --git a/commit.h b/commit.h index 30702ca..6738a69 100644 --- a/commit.h +++ b/commit.h @@ -43,6 +43,7 @@ enum cmit_fmt { CMIT_FMT_DEFAULT = CMIT_FMT_MEDIUM, CMIT_FMT_SHORT, CMIT_FMT_FULL, + CMIT_FMT_FULLER, CMIT_FMT_ONELINE, }; -- cgit v0.10.2-6-g49f6 From 17cf939724a244a56e687559fae062a3e6207145 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 9 Nov 2005 22:37:14 -0800 Subject: octopus: do not do AND'ed merge base. When doing an octopus, we incorrectly used the previous merge base as the reference to compute next merge base. This was unnecessary, because that can never be better than using the original HEAD. And that is far simpler as well ;-). Signed-off-by: Junio C Hamano diff --git a/git-merge-octopus.sh b/git-merge-octopus.sh index aa1cd2f..bb58e22 100755 --- a/git-merge-octopus.sh +++ b/git-merge-octopus.sh @@ -5,6 +5,9 @@ # Resolve two or more trees. # +LF=' +' + # The first parameters up to -- are merge bases; the rest are heads. bases= head= remotes= sep_seen= for arg @@ -42,14 +45,18 @@ CNT=1 ;# counting our head NON_FF_MERGE=0 for SHA1 in $remotes do - common=$(git-merge-base $MRC $SHA1) || + common=$(git-merge-base --all $MRC $SHA1) || die "Unable to find common commit with $SHA1" - if test "$common" = $SHA1 - then + case "$common" in + ?*"$LF"?*) + die "Not trivially mergeable." + ;; + $SHA1) echo "Already up-to-date with $SHA1" continue - fi + ;; + esac CNT=`expr $CNT + 1` PARENT="$PARENT -p $SHA1" @@ -79,7 +86,15 @@ do exit 2 ; # Automatic merge failed; should not be doing Octopus next=$(git-write-tree 2>/dev/null) fi - MRC=$common + + # We have merged the other branch successfully. Ideally + # we could implement OR'ed heads in merge-base, and keep + # a list of commits we have merged so far in MRC to feed + # them to merge-base, but we approximate it by keep using + # the current MRC. We used to update it to $common, which + # was incorrectly doing AND'ed merge-base here, which was + # unneeded. + MRT=$next done -- cgit v0.10.2-6-g49f6 From 601c978c1bc9f6742c18932cb9d4a6910934f785 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Thu, 10 Nov 2005 00:30:12 -0500 Subject: Add --no-commit-id option for git-diff-tree, use it in gitk This patch introduces -no-commit-id option for git-diff-tree, which suppresses commit ID output. [jc: dropped gitk part for now.] Signed-off-by: Pavel Roskin Signed-off-by: Junio C Hamano diff --git a/Documentation/git-diff-tree.txt b/Documentation/git-diff-tree.txt index f57c8d0..9a2947e 100644 --- a/Documentation/git-diff-tree.txt +++ b/Documentation/git-diff-tree.txt @@ -8,7 +8,7 @@ git-diff-tree - Compares the content and mode of blobs found via two tree object SYNOPSIS -------- -'git-diff-tree' [--stdin] [-m] [-s] [-v] [--pretty] [-t] [-r] [--root] [] [] [...] +'git-diff-tree' [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty] [-t] [-r] [--root] [] [] [...] DESCRIPTION ----------- @@ -74,6 +74,10 @@ separated with a single space are given. commit message. Without "=