From 1ca3d6ed01774eab37e96d9c88b840ea618f97af Mon Sep 17 00:00:00 2001 From: Jay Soffian Date: Wed, 20 Feb 2008 00:55:07 -0500 Subject: send-email: squelch warning due to comparing undefined $_ to "" The check to see if initial_reply_to is defined was also comparing $_ to "" for a reason I cannot ascertain (looking at the commit which made the change didn't provide enlightenment), but if $_ is undefined, perl generates a warning. Signed-off-by: Jay Soffian Signed-off-by: Junio C Hamano diff --git a/git-send-email.perl b/git-send-email.perl index a1a9d14..8e6f3b2 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -406,7 +406,7 @@ if ($thread && !defined $initial_reply_to && $prompting) { $initial_reply_to = $_; } -if (defined $initial_reply_to && $_ ne "") { +if (defined $initial_reply_to) { $initial_reply_to =~ s/^\s*?\s*$/>/; } -- cgit v0.10.2-6-g49f6 From fbd538c262b03d7b096e840a7ef0cdd54c5cea4f Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 20 Feb 2008 12:31:35 +0100 Subject: Documentation/git-stash: document options for git stash list Signed-off-by: Miklos Vajna Signed-off-by: Junio C Hamano diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index cd0dc1b..48e6f5a 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -43,7 +43,7 @@ save []:: subcommand is given. The part is optional and gives the description along with the stashed state. -list:: +list []:: List the stashes that you currently have. Each 'stash' is listed with its name (e.g. `stash@\{0}` is the latest stash, `stash@\{1}` is @@ -55,6 +55,9 @@ list:: stash@{0}: WIP on submit: 6ebd0e2... Update git-stash documentation stash@{1}: On master: 9cc0589... Add git-stash ---------------------------------------------------------------- ++ +The command takes options applicable to the linkgit:git-log[1] +command to control what is shown and how. show []:: -- cgit v0.10.2-6-g49f6 From 5274ba6907cc12d6e6556ff85cb0e4819bd3f730 Mon Sep 17 00:00:00 2001 From: Gerrit Pape Date: Wed, 20 Feb 2008 15:10:17 +0000 Subject: git-clone.sh: properly configure remote even if remote's head is dangling When cloning a remote repository which's HEAD refers to a nonexistent ref, git-clone cloned all existing refs, but failed to write the configuration for 'remote'. Now it detects the dangling remote HEAD, refuses to checkout any local branch since HEAD refers to nowhere, but properly writes the configuration for 'remote', so that subsequent 'git fetch's don't fail. The problem was reported by Daniel Jacobowitz through http://bugs.debian.org/466581 Signed-off-by: Gerrit Pape Signed-off-by: Junio C Hamano diff --git a/git-clone.sh b/git-clone.sh index b4e858c..0d686c3 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -409,11 +409,12 @@ else cd "$D" || exit fi -if test -z "$bare" && test -f "$GIT_DIR/REMOTE_HEAD" +if test -z "$bare" then # a non-bare repository is always in separate-remote layout remote_top="refs/remotes/$origin" - head_sha1=`cat "$GIT_DIR/REMOTE_HEAD"` + head_sha1= + test ! -r "$GIT_DIR/REMOTE_HEAD" || head_sha1=`cat "$GIT_DIR/REMOTE_HEAD"` case "$head_sha1" in 'ref: refs/'*) # Uh-oh, the remote told us (http transport done against @@ -470,9 +471,16 @@ then git config branch."$head_points_at".merge "refs/heads/$head_points_at" ;; '') - # Source had detached HEAD pointing nowhere - git update-ref --no-deref HEAD "$head_sha1" && - rm -f "refs/remotes/$origin/HEAD" + if test -z "$head_sha1" + then + # Source had nonexistent ref in HEAD + echo >&2 "Warning: Remote HEAD refers to nonexistent ref, unable to checkout." + no_checkout=t + else + # Source had detached HEAD pointing nowhere + git update-ref --no-deref HEAD "$head_sha1" && + rm -f "refs/remotes/$origin/HEAD" + fi ;; esac diff --git a/t/t5701-clone-local.sh b/t/t5701-clone-local.sh index 822ac8c..59a165a 100755 --- a/t/t5701-clone-local.sh +++ b/t/t5701-clone-local.sh @@ -63,4 +63,12 @@ test_expect_success 'Even without -l, local will make a hardlink' ' test 0 = $copied ' +test_expect_success 'local clone of repo with nonexistent ref in HEAD' ' + cd "$D" && + echo "ref: refs/heads/nonexistent" > a.git/HEAD && + git clone a d && + cd d && + git fetch && + test ! -e .git/refs/remotes/origin/HEAD' + test_done -- cgit v0.10.2-6-g49f6 From 0ca15e7217285edaa6c93b53165e1250d25f030b Mon Sep 17 00:00:00 2001 From: Pekka Kaitaniemi Date: Thu, 21 Feb 2008 00:29:39 +0200 Subject: Clarified the meaning of git-add -u in the documentation The git-add documentation did not state clearly that the -u switch updates only the tracked files that are in the current directory and its subdirectories. Signed-off-by: Pekka Kaitaniemi Signed-off-by: Junio C Hamano diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt index 9d2ac86..4779909 100644 --- a/Documentation/git-add.txt +++ b/Documentation/git-add.txt @@ -74,8 +74,8 @@ OPTIONS Update only files that git already knows about. This is similar to what "git commit -a" does in preparation for making a commit, except that the update is limited to paths specified on the - command line. If no paths are specified, all tracked files are - updated. + command line. If no paths are specified, all tracked files in the + current directory and its subdirectories are updated. \--refresh:: Don't add the file(s), but only refresh their stat() -- cgit v0.10.2-6-g49f6