{"thread":{"id":"23044","subject":"[PATCH] bash: complete *_HEAD refs if present","startedAt":"2010-03-17T09:20:35Z","lastAt":"2010-03-17T15:40:20Z","messageCount":2,"participants":["Ian Ward Comfort","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"136993","messageId":"1268817635-7946-1-git-send-email-icomfort@stanford.edu","threadId":"23044","inReplyTo":null,"subject":"[PATCH] bash: complete *_HEAD refs if present","fromName":"Ian Ward Comfort","fromEmail":"icomfort@stanford.edu","sentAt":"2010-03-17T09:20:35Z","receivedAt":"2010-03-17T09:20:35Z","isPatch":true,"sender":{"key":"icomfort@stanford.edu","avatar":"https://avatars.githubusercontent.com/u/202841?v=4"},"body":"We already complete HEAD, of course, and might as well complete the other\ncommon refs mentioned in the rev-parse man page: FETCH_HEAD, ORIG_HEAD, and\nMERGE_HEAD.\n\nSigned-off-by: Ian Ward Comfort <icomfort@stanford.edu>\n---\n contrib/completion/git-completion.bash |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex fe93747..733ac39 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -250,7 +250,9 @@ __git_refs ()\n \t\t\trefs=\"${cur%/*}\"\n \t\t\t;;\n \t\t*)\n-\t\t\tif [ -e \"$dir/HEAD\" ]; then echo HEAD; fi\n+\t\t\tfor i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do\n+\t\t\t\tif [ -e \"$dir/$i\" ]; then echo $i; fi\n+\t\t\tdone\n \t\t\tformat=\"refname:short\"\n \t\t\trefs=\"refs/tags refs/heads refs/remotes\"\n \t\t\t;;\n-- \n1.7.0.2\n"},{"id":"137024","messageId":"20100317154020.GD1871@spearce.org","threadId":"23044","inReplyTo":"1268817635-7946-1-git-send-email-icomfort@stanford.edu","subject":"Re: [PATCH] bash: complete *_HEAD refs if present","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2010-03-17T15:40:20Z","receivedAt":"2010-03-17T15:40:20Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Ian Ward Comfort <icomfort@stanford.edu> wrote:\n> We already complete HEAD, of course, and might as well complete the other\n> common refs mentioned in the rev-parse man page: FETCH_HEAD, ORIG_HEAD, and\n> MERGE_HEAD.\n\nAcked-by: Shawn O. Pearce <spearce@spearce.org>\n\n \n> Signed-off-by: Ian Ward Comfort <icomfort@stanford.edu>\n> ---\n>  contrib/completion/git-completion.bash |    4 +++-\n>  1 files changed, 3 insertions(+), 1 deletions(-)\n> \n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index fe93747..733ac39 100755\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -250,7 +250,9 @@ __git_refs ()\n>  \t\t\trefs=\"${cur%/*}\"\n>  \t\t\t;;\n>  \t\t*)\n> -\t\t\tif [ -e \"$dir/HEAD\" ]; then echo HEAD; fi\n> +\t\t\tfor i in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD; do\n> +\t\t\t\tif [ -e \"$dir/$i\" ]; then echo $i; fi\n> +\t\t\tdone\n>  \t\t\tformat=\"refname:short\"\n>  \t\t\trefs=\"refs/tags refs/heads refs/remotes\"\n>  \t\t\t;;\n\n-- \nShawn.\n"}]}