{"thread":{"id":"13276","subject":"[PATCH] bash: Add completion for gitk --merge","startedAt":"2008-04-26T23:32:14Z","lastAt":"2008-04-27T17:19:56Z","messageCount":4,"participants":["Richard Quirk","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"75244","messageId":"1209252734-10861-1-git-send-email-richard.quirk@gmail.com","threadId":"13276","inReplyTo":null,"subject":"[PATCH] bash: Add completion for gitk --merge","fromName":"Richard Quirk","fromEmail":"richard.quirk@gmail.com","sentAt":"2008-04-26T23:32:14Z","receivedAt":"2008-04-26T23:32:14Z","isPatch":true,"sender":{"key":"richard.quirk@gmail.com","avatar":null},"body":"Option is only completed when .git/MERGE_HEAD is present.\n\nSigned-off-by: Richard Quirk <richard.quirk@gmail.com>\n---\n contrib/completion/git-completion.bash |    7 ++++++-\n 1 files changed, 6 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 665a895..2565aa6 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1346,9 +1346,14 @@ _git ()\n _gitk ()\n {\n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n+\tlocal g=\"$(git rev-parse --git-dir 2>/dev/null)\"\n+\tlocal merge=\"\"\n+\tif [ -f $g/MERGE_HEAD ]; then\n+\t\tlocal merge=\"--merge\"\n+\tfi\n \tcase \"$cur\" in\n \t--*)\n-\t\t__gitcomp \"--not --all\"\n+\t\t__gitcomp \"--not --all $merge\"\n \t\treturn\n \t\t;;\n \tesac\n-- \n1.5.5.1.79.g57cf\n"},{"id":"75250","messageId":"20080427041816.GH29771@spearce.org","threadId":"13276","inReplyTo":"1209252734-10861-1-git-send-email-richard.quirk@gmail.com","subject":"Re: [PATCH] bash: Add completion for gitk --merge","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-04-27T04:18:16Z","receivedAt":"2008-04-27T04:18:16Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Richard Quirk <richard.quirk@gmail.com> wrote:\n> Option is only completed when .git/MERGE_HEAD is present.\n> \n> Signed-off-by: Richard Quirk <richard.quirk@gmail.com>\n> ---\n>  contrib/completion/git-completion.bash |    7 ++++++-\n>  1 files changed, 6 insertions(+), 1 deletions(-)\n\nNice.\n \n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 665a895..2565aa6 100755\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -1346,9 +1346,14 @@ _git ()\n>  _gitk ()\n>  {\n>  \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n> +\tlocal g=\"$(git rev-parse --git-dir 2>/dev/null)\"\n> +\tlocal merge=\"\"\n> +\tif [ -f $g/MERGE_HEAD ]; then\n> +\t\tlocal merge=\"--merge\"\n\nI don't think the extra \"local\" is necessary within the if block;\nyou have already declared it to be local when you initialized it\nto the empty string.\n\n-- \nShawn.\n"},{"id":"75298","messageId":"1209310510-7201-1-git-send-email-richard.quirk@gmail.com","threadId":"13276","inReplyTo":"20080427041816.GH29771@spearce.org","subject":"[PATCH] bash: Add completion for gitk --merge","fromName":"Richard Quirk","fromEmail":"richard.quirk@gmail.com","sentAt":"2008-04-27T15:35:10Z","receivedAt":"2008-04-27T15:35:10Z","isPatch":true,"sender":{"key":"richard.quirk@gmail.com","avatar":null},"body":"Option is only completed when .git/MERGE_HEAD is present.\n\nSigned-off-by: Richard Quirk <richard.quirk@gmail.com>\n---\n contrib/completion/git-completion.bash |    7 ++++++-\n 1 files changed, 6 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 665a895..23db664 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -1346,9 +1346,14 @@ _git ()\n _gitk ()\n {\n \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n+\tlocal g=\"$(git rev-parse --git-dir 2>/dev/null)\"\n+\tlocal merge=\"\"\n+\tif [ -f $g/MERGE_HEAD ]; then\n+\t\tmerge=\"--merge\"\n+\tfi\n \tcase \"$cur\" in\n \t--*)\n-\t\t__gitcomp \"--not --all\"\n+\t\t__gitcomp \"--not --all $merge\"\n \t\treturn\n \t\t;;\n \tesac\n-- \n1.5.5.1.79.g57cf\n"},{"id":"75301","messageId":"20080427171956.GK29771@spearce.org","threadId":"13276","inReplyTo":"1209310510-7201-1-git-send-email-richard.quirk@gmail.com","subject":"Re: [PATCH] bash: Add completion for gitk --merge","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-04-27T17:19:56Z","receivedAt":"2008-04-27T17:19:56Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Richard Quirk <richard.quirk@gmail.com> wrote:\n> Option is only completed when .git/MERGE_HEAD is present.\n> \n> Signed-off-by: Richard Quirk <richard.quirk@gmail.com>\n\nThanks for fixing the unnecessary local and resubmitting.\n\nAcked-by: Shawn O. Pearce <spearce@spearce.org>\n\n> ---\n>  contrib/completion/git-completion.bash |    7 ++++++-\n>  1 files changed, 6 insertions(+), 1 deletions(-)\n> \n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 665a895..23db664 100755\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -1346,9 +1346,14 @@ _git ()\n>  _gitk ()\n>  {\n>  \tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n> +\tlocal g=\"$(git rev-parse --git-dir 2>/dev/null)\"\n> +\tlocal merge=\"\"\n> +\tif [ -f $g/MERGE_HEAD ]; then\n> +\t\tmerge=\"--merge\"\n> +\tfi\n>  \tcase \"$cur\" in\n>  \t--*)\n> -\t\t__gitcomp \"--not --all\"\n> +\t\t__gitcomp \"--not --all $merge\"\n>  \t\treturn\n>  \t\t;;\n>  \tesac\n> -- \n> 1.5.5.1.79.g57cf\n> \n\n-- \nShawn.\n"}]}