{"thread":{"id":"17085","subject":"[PATCH] bash completion: refactor diff options","startedAt":"2009-01-11T13:14:23Z","lastAt":"2009-01-20T08:36:14Z","messageCount":8,"participants":["Thomas Rast","Junio C Hamano","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"99954","messageId":"1231679663-31907-1-git-send-email-trast@student.ethz.ch","threadId":"17085","inReplyTo":null,"subject":"[PATCH] bash completion: refactor diff options","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-01-11T13:14:23Z","receivedAt":"2009-01-11T13:14:23Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"diff, log and show all take the same diff options.  Refactor them from\n__git_diff and __git_log into a variable, and complete them in\n__git_show too.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n\n---\n\nThis conflicts with the --patience series; I can send a version based\non that if it goes in first.\n\n\n contrib/completion/git-completion.bash |   38 ++++++++++++++++++-------------\n 1 files changed, 22 insertions(+), 16 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 7b074d7..5017369 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -759,24 +759,29 @@ _git_describe ()\n \t__gitcomp \"$(__git_refs)\"\n }\n \n-_git_diff ()\n-{\n-\t__git_has_doubledash && return\n-\n-\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n-\tcase \"$cur\" in\n-\t--*)\n-\t\t__gitcomp \"--cached --stat --numstat --shortstat --summary\n+__git_diff_common_options=\"--stat --numstat --shortstat --summary\n \t\t\t--patch-with-stat --name-only --name-status --color\n \t\t\t--no-color --color-words --no-renames --check\n \t\t\t--full-index --binary --abbrev --diff-filter=\n-\t\t\t--find-copies-harder --pickaxe-all --pickaxe-regex\n+\t\t\t--find-copies-harder\n \t\t\t--text --ignore-space-at-eol --ignore-space-change\n \t\t\t--ignore-all-space --exit-code --quiet --ext-diff\n \t\t\t--no-ext-diff\n \t\t\t--no-prefix --src-prefix= --dst-prefix=\n-\t\t\t--base --ours --theirs\n \t\t\t--inter-hunk-context=\n+\t\t\t--raw\n+\"\n+\n+_git_diff ()\n+{\n+\t__git_has_doubledash && return\n+\n+\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n+\tcase \"$cur\" in\n+\t--*)\n+\t\t__gitcomp \"--cached --pickaxe-all --pickaxe-regex\n+\t\t\t--base --ours --theirs\n+\t\t\t$__git_diff_common_options\n \t\t\t\"\n \t\treturn\n \t\t;;\n@@ -959,16 +964,15 @@ _git_log ()\n \t\t\t--relative-date --date=\n \t\t\t--author= --committer= --grep=\n \t\t\t--all-match\n-\t\t\t--pretty= --name-status --name-only --raw\n+\t\t\t--pretty=\n \t\t\t--not --all\n \t\t\t--left-right --cherry-pick\n \t\t\t--graph\n-\t\t\t--stat --numstat --shortstat\n-\t\t\t--decorate --diff-filter=\n-\t\t\t--color-words --walk-reflogs\n+\t\t\t--decorate\n+\t\t\t--walk-reflogs\n \t\t\t--parents --children --full-history\n \t\t\t--merge\n-\t\t\t--inter-hunk-context=\n+\t\t\t$__git_diff_common_options\n \t\t\t\"\n \t\treturn\n \t\t;;\n@@ -1473,7 +1477,9 @@ _git_show ()\n \t\treturn\n \t\t;;\n \t--*)\n-\t\t__gitcomp \"--pretty=\"\n+\t\t__gitcomp \"--pretty=\n+\t\t\t$__git_diff_common_options\n+\t\t\t\"\n \t\treturn\n \t\t;;\n \tesac\n-- \ntg: (7eb5bbd..) t/bash-complete-show (depends on: origin/master)\n"},{"id":"100087","messageId":"1231751817-17688-1-git-send-email-trast@student.ethz.ch","threadId":"17085","inReplyTo":"1231679663-31907-1-git-send-email-trast@student.ethz.ch","subject":"[PATCH next] bash completion: refactor diff options","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-01-12T09:16:57Z","receivedAt":"2009-01-12T09:16:57Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"diff, log and show all take the same diff options.  Refactor them from\n__git_diff and __git_log into a variable, and complete them in\n__git_show too.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n\n---\n\njs/patience-diff is now in next, so here's a version on top of that.\n\n\n contrib/completion/git-completion.bash |   38 ++++++++++++++++++-------------\n 1 files changed, 22 insertions(+), 16 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex dee75b5..39ae7a3 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -759,25 +759,30 @@ _git_describe ()\n \t__gitcomp \"$(__git_refs)\"\n }\n \n-_git_diff ()\n-{\n-\t__git_has_doubledash && return\n-\n-\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n-\tcase \"$cur\" in\n-\t--*)\n-\t\t__gitcomp \"--cached --stat --numstat --shortstat --summary\n+__git_diff_common_options=\"--stat --numstat --shortstat --summary\n \t\t\t--patch-with-stat --name-only --name-status --color\n \t\t\t--no-color --color-words --no-renames --check\n \t\t\t--full-index --binary --abbrev --diff-filter=\n-\t\t\t--find-copies-harder --pickaxe-all --pickaxe-regex\n+\t\t\t--find-copies-harder\n \t\t\t--text --ignore-space-at-eol --ignore-space-change\n \t\t\t--ignore-all-space --exit-code --quiet --ext-diff\n \t\t\t--no-ext-diff\n \t\t\t--no-prefix --src-prefix= --dst-prefix=\n-\t\t\t--base --ours --theirs\n \t\t\t--inter-hunk-context=\n \t\t\t--patience\n+\t\t\t--raw\n+\"\n+\n+_git_diff ()\n+{\n+\t__git_has_doubledash && return\n+\n+\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n+\tcase \"$cur\" in\n+\t--*)\n+\t\t__gitcomp \"--cached --pickaxe-all --pickaxe-regex\n+\t\t\t--base --ours --theirs\n+\t\t\t$__git_diff_common_options\n \t\t\t\"\n \t\treturn\n \t\t;;\n@@ -960,17 +965,16 @@ _git_log ()\n \t\t\t--relative-date --date=\n \t\t\t--author= --committer= --grep=\n \t\t\t--all-match\n-\t\t\t--pretty= --name-status --name-only --raw\n+\t\t\t--pretty=\n \t\t\t--not --all\n \t\t\t--left-right --cherry-pick\n \t\t\t--graph\n-\t\t\t--stat --numstat --shortstat\n-\t\t\t--decorate --diff-filter=\n-\t\t\t--color-words --walk-reflogs\n+\t\t\t--decorate\n+\t\t\t--walk-reflogs\n \t\t\t--parents --children --full-history\n \t\t\t--merge\n \t\t\t--inter-hunk-context=\n-\t\t\t--patience\n+\t\t\t$__git_diff_common_options\n \t\t\t\"\n \t\treturn\n \t\t;;\n@@ -1475,7 +1479,9 @@ _git_show ()\n \t\treturn\n \t\t;;\n \t--*)\n-\t\t__gitcomp \"--pretty=\"\n+\t\t__gitcomp \"--pretty=\n+\t\t\t$__git_diff_common_options\n+\t\t\t\"\n \t\treturn\n \t\t;;\n \tesac\n-- \ntg: (f5cbdbb..) t/bash-complete-show (depends on: origin/next)\n"},{"id":"100900","messageId":"1232240603-11729-1-git-send-email-trast@student.ethz.ch","threadId":"17085","inReplyTo":"1231679663-31907-1-git-send-email-trast@student.ethz.ch","subject":"[PATCH next resend] bash completion: refactor diff options","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-01-18T01:03:23Z","receivedAt":"2009-01-18T01:03:23Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"diff, log and show all take the same diff options.  Refactor them from\n__git_diff and __git_log into a variable, and complete them in\n__git_show too.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n\n---\n\nAny news on this?\n\n\n contrib/completion/git-completion.bash |   38 ++++++++++++++++++-------------\n 1 files changed, 22 insertions(+), 16 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 70a6b44..40e3a14 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -774,25 +774,30 @@ _git_describe ()\n \t__gitcomp \"$(__git_refs)\"\n }\n \n-_git_diff ()\n-{\n-\t__git_has_doubledash && return\n-\n-\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n-\tcase \"$cur\" in\n-\t--*)\n-\t\t__gitcomp \"--cached --stat --numstat --shortstat --summary\n+__git_diff_common_options=\"--stat --numstat --shortstat --summary\n \t\t\t--patch-with-stat --name-only --name-status --color\n \t\t\t--no-color --color-words --no-renames --check\n \t\t\t--full-index --binary --abbrev --diff-filter=\n-\t\t\t--find-copies-harder --pickaxe-all --pickaxe-regex\n+\t\t\t--find-copies-harder\n \t\t\t--text --ignore-space-at-eol --ignore-space-change\n \t\t\t--ignore-all-space --exit-code --quiet --ext-diff\n \t\t\t--no-ext-diff\n \t\t\t--no-prefix --src-prefix= --dst-prefix=\n-\t\t\t--base --ours --theirs\n \t\t\t--inter-hunk-context=\n \t\t\t--patience\n+\t\t\t--raw\n+\"\n+\n+_git_diff ()\n+{\n+\t__git_has_doubledash && return\n+\n+\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n+\tcase \"$cur\" in\n+\t--*)\n+\t\t__gitcomp \"--cached --pickaxe-all --pickaxe-regex\n+\t\t\t--base --ours --theirs\n+\t\t\t$__git_diff_common_options\n \t\t\t\"\n \t\treturn\n \t\t;;\n@@ -975,17 +980,16 @@ _git_log ()\n \t\t\t--relative-date --date=\n \t\t\t--author= --committer= --grep=\n \t\t\t--all-match\n-\t\t\t--pretty= --name-status --name-only --raw\n+\t\t\t--pretty=\n \t\t\t--not --all\n \t\t\t--left-right --cherry-pick\n \t\t\t--graph\n-\t\t\t--stat --numstat --shortstat\n-\t\t\t--decorate --diff-filter=\n-\t\t\t--color-words --walk-reflogs\n+\t\t\t--decorate\n+\t\t\t--walk-reflogs\n \t\t\t--parents --children --full-history\n \t\t\t--merge\n \t\t\t--inter-hunk-context=\n-\t\t\t--patience\n+\t\t\t$__git_diff_common_options\n \t\t\t\"\n \t\treturn\n \t\t;;\n@@ -1490,7 +1494,9 @@ _git_show ()\n \t\treturn\n \t\t;;\n \t--*)\n-\t\t__gitcomp \"--pretty=\"\n+\t\t__gitcomp \"--pretty=\n+\t\t\t$__git_diff_common_options\n+\t\t\t\"\n \t\treturn\n \t\t;;\n \tesac\n-- \ntg: (7ff1443..) t/bash-complete-show (depends on: origin/next)\n"},{"id":"100921","messageId":"7vtz7xytdo.fsf@gitster.siamese.dyndns.org","threadId":"17085","inReplyTo":"1232240603-11729-1-git-send-email-trast@student.ethz.ch","subject":"Re: [PATCH next resend] bash completion: refactor diff options","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-18T07:18:27Z","receivedAt":"2009-01-18T07:18:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Rast <trast@student.ethz.ch> writes:\n\n> diff, log and show all take the same diff options.  Refactor them from\n> __git_diff and __git_log into a variable, and complete them in\n> __git_show too.\n>\n> Signed-off-by: Thomas Rast <trast@student.ethz.ch>\n>\n> ---\n>\n> Any news on this?\n\n> +__git_diff_common_options=\"--stat --numstat --shortstat --summary\n>  \t\t\t--patch-with-stat --name-only --name-status --color\n>  \t\t\t--no-color --color-words --no-renames --check\n>  \t\t\t--full-index --binary --abbrev --diff-filter=\n> -\t\t\t--find-copies-harder --pickaxe-all --pickaxe-regex\n> +\t\t\t--find-copies-harder\n\nThe changes around pickaxe made me \"Huh?\".  For log pickaxe makes very\ngood sense but for a single diff it doesn't, yet the original seems to\nhave had them only on \"git diff\" and not on \"git log\", which feels wrong.\n\nOther than that, I think the patch tries to achieve a great thing in the\nlonger term---we do not have to worry about common parts going out of sync\nbetween diff and log family of commands.\n"},{"id":"101146","messageId":"20090119173153.GB14053@spearce.org","threadId":"17085","inReplyTo":"7vtz7xytdo.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH next resend] bash completion: refactor diff options","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-01-19T17:31:53Z","receivedAt":"2009-01-19T17:31:53Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n> Thomas Rast <trast@student.ethz.ch> writes:\n> \n> > +__git_diff_common_options=\"--stat --numstat --shortstat --summary\n> >  \t\t\t--patch-with-stat --name-only --name-status --color\n> >  \t\t\t--no-color --color-words --no-renames --check\n> >  \t\t\t--full-index --binary --abbrev --diff-filter=\n> > -\t\t\t--find-copies-harder --pickaxe-all --pickaxe-regex\n> > +\t\t\t--find-copies-harder\n> \n> The changes around pickaxe made me \"Huh?\".  For log pickaxe makes very\n> good sense but for a single diff it doesn't, yet the original seems to\n> have had them only on \"git diff\" and not on \"git log\", which feels wrong.\n> \n> Other than that, I think the patch tries to achieve a great thing in the\n> longer term---we do not have to worry about common parts going out of sync\n> between diff and log family of commands.\n\nI agree completely.  The pickaxe stuff in current completion is\njust plain wrong.  I'd like to see it fixed with this cleanup.\nMaybe do it in two parts; fix the pickaxe options to be on log\nand not diff, and then do the cleanup for the common options.\n\n-- \nShawn.\n"},{"id":"101168","messageId":"1232399880-22036-1-git-send-email-trast@student.ethz.ch","threadId":"17085","inReplyTo":"20090119173153.GB14053@spearce.org","subject":"[PATCH v2 1/2] bash completion: move pickaxe options to log","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-01-19T21:17:59Z","receivedAt":"2009-01-19T21:17:59Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Move the options --pickaxe-all and --pickaxe-regex to git-log, where\nthey make more sense than with git-diff.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n\n---\n\nShawn O. Pearce wrote:\n> Junio C Hamano <gitster@pobox.com> wrote:\n> > The changes around pickaxe made me \"Huh?\".  For log pickaxe makes very\n> > good sense but for a single diff it doesn't, yet the original seems to\n> > have had them only on \"git diff\" and not on \"git log\", which feels wrong.\n> \n> I agree completely.  The pickaxe stuff in current completion is\n> just plain wrong.  I'd like to see it fixed with this cleanup.\n> Maybe do it in two parts; fix the pickaxe options to be on log\n> and not diff, and then do the cleanup for the common options.\n\nGood point.  Sorry for not noticing in the first place; I was too\nfocused on just getting git-show completion working ;-)\n\n\n contrib/completion/git-completion.bash |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 60497a4..b5d3bbb 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -784,7 +784,7 @@ _git_diff ()\n \t\t\t--patch-with-stat --name-only --name-status --color\n \t\t\t--no-color --color-words --no-renames --check\n \t\t\t--full-index --binary --abbrev --diff-filter=\n-\t\t\t--find-copies-harder --pickaxe-all --pickaxe-regex\n+\t\t\t--find-copies-harder\n \t\t\t--text --ignore-space-at-eol --ignore-space-change\n \t\t\t--ignore-all-space --exit-code --quiet --ext-diff\n \t\t\t--no-ext-diff\n@@ -986,6 +986,7 @@ _git_log ()\n \t\t\t--parents --children --full-history\n \t\t\t--merge\n \t\t\t--inter-hunk-context=\n+\t\t\t--pickaxe-all --pickaxe-regex\n \t\t\t\"\n \t\treturn\n \t\t;;\n-- \ntg: (28da86a..) t/bash-complete-pickaxe (depends on: origin/master)\n"},{"id":"101169","messageId":"1232399880-22036-2-git-send-email-trast@student.ethz.ch","threadId":"17085","inReplyTo":"1232399880-22036-1-git-send-email-trast@student.ethz.ch","subject":"[PATCH v2 2/2] bash completion: refactor diff options","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-01-19T21:18:00Z","receivedAt":"2009-01-19T21:18:00Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"diff, log and show all take the same diff options.  Refactor them from\n__git_diff and __git_log into a variable, and complete them in\n__git_show too.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n\n---\n contrib/completion/git-completion.bash |   36 ++++++++++++++++++-------------\n 1 files changed, 21 insertions(+), 15 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 096603b..bfae953 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -773,14 +773,7 @@ _git_describe ()\n \t__gitcomp \"$(__git_refs)\"\n }\n \n-_git_diff ()\n-{\n-\t__git_has_doubledash && return\n-\n-\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n-\tcase \"$cur\" in\n-\t--*)\n-\t\t__gitcomp \"--cached --stat --numstat --shortstat --summary\n+__git_diff_common_options=\"--stat --numstat --shortstat --summary\n \t\t\t--patch-with-stat --name-only --name-status --color\n \t\t\t--no-color --color-words --no-renames --check\n \t\t\t--full-index --binary --abbrev --diff-filter=\n@@ -789,9 +782,21 @@ _git_diff ()\n \t\t\t--ignore-all-space --exit-code --quiet --ext-diff\n \t\t\t--no-ext-diff\n \t\t\t--no-prefix --src-prefix= --dst-prefix=\n-\t\t\t--base --ours --theirs\n \t\t\t--inter-hunk-context=\n \t\t\t--patience\n+\t\t\t--raw\n+\"\n+\n+_git_diff ()\n+{\n+\t__git_has_doubledash && return\n+\n+\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n+\tcase \"$cur\" in\n+\t--*)\n+\t\t__gitcomp \"--cached --pickaxe-all --pickaxe-regex\n+\t\t\t--base --ours --theirs\n+\t\t\t$__git_diff_common_options\n \t\t\t\"\n \t\treturn\n \t\t;;\n@@ -977,17 +982,16 @@ _git_log ()\n \t\t\t--relative-date --date=\n \t\t\t--author= --committer= --grep=\n \t\t\t--all-match\n-\t\t\t--pretty= --name-status --name-only --raw\n+\t\t\t--pretty=\n \t\t\t--not --all\n \t\t\t--left-right --cherry-pick\n \t\t\t--graph\n-\t\t\t--stat --numstat --shortstat\n-\t\t\t--decorate --diff-filter=\n-\t\t\t--color-words --walk-reflogs\n+\t\t\t--decorate\n+\t\t\t--walk-reflogs\n \t\t\t--parents --children --full-history\n \t\t\t--merge\n \t\t\t--inter-hunk-context=\n-\t\t\t--patience\n+\t\t\t$__git_diff_common_options\n \t\t\t--pickaxe-all --pickaxe-regex\n \t\t\t\"\n \t\treturn\n@@ -1492,7 +1496,9 @@ _git_show ()\n \t\treturn\n \t\t;;\n \t--*)\n-\t\t__gitcomp \"--pretty=\"\n+\t\t__gitcomp \"--pretty=\n+\t\t\t$__git_diff_common_options\n+\t\t\t\"\n \t\treturn\n \t\t;;\n \tesac\n-- \ntg: (3f8c856..) t/bash-complete-show (depends on: origin/next t/bash-complete-pickaxe t/bash-complete-pickaxe)\n"},{"id":"101234","messageId":"7vwscqjrwh.fsf@gitster.siamese.dyndns.org","threadId":"17085","inReplyTo":"1232399880-22036-2-git-send-email-trast@student.ethz.ch","subject":"Re: [PATCH v2 2/2] bash completion: refactor diff options","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-01-20T08:36:14Z","receivedAt":"2009-01-20T08:36:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Rast <trast@student.ethz.ch> writes:\n\n> diff, log and show all take the same diff options.  Refactor them from\n> __git_diff and __git_log into a variable, and complete them in\n> __git_show too.\n>\n> Signed-off-by: Thomas Rast <trast@student.ethz.ch>\n>\n> ---\n>  contrib/completion/git-completion.bash |   36 ++++++++++++++++++-------------\n>  1 files changed, 21 insertions(+), 15 deletions(-)\n>\n> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\n> index 096603b..bfae953 100755\n> --- a/contrib/completion/git-completion.bash\n> +++ b/contrib/completion/git-completion.bash\n> @@ -773,14 +773,7 @@ _git_describe ()\n>  \t__gitcomp \"$(__git_refs)\"\n>  }\n>  \n> -_git_diff ()\n> -{\n> -\t__git_has_doubledash && return\n> -\n> -\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n> -\tcase \"$cur\" in\n> -\t--*)\n> -\t\t__gitcomp \"--cached --stat --numstat --shortstat --summary\n> +__git_diff_common_options=\"--stat --numstat --shortstat --summary\n>  \t\t\t--patch-with-stat --name-only --name-status --color\n>  \t\t\t--no-color --color-words --no-renames --check\n>  \t\t\t--full-index --binary --abbrev --diff-filter=\n> @@ -789,9 +782,21 @@ _git_diff ()\n>  \t\t\t--ignore-all-space --exit-code --quiet --ext-diff\n>  \t\t\t--no-ext-diff\n>  \t\t\t--no-prefix --src-prefix= --dst-prefix=\n> -\t\t\t--base --ours --theirs\n>  \t\t\t--inter-hunk-context=\n>  \t\t\t--patience\n> +\t\t\t--raw\n> +\"\n> +\n> +_git_diff ()\n> +{\n> +\t__git_has_doubledash && return\n> +\n> +\tlocal cur=\"${COMP_WORDS[COMP_CWORD]}\"\n> +\tcase \"$cur\" in\n> +\t--*)\n> +\t\t__gitcomp \"--cached --pickaxe-all --pickaxe-regex\n> +\t\t\t--base --ours --theirs\n> +\t\t\t$__git_diff_common_options\n>  \t\t\t\"\n>  \t\treturn\n>  \t\t;;\n> @@ -977,17 +982,16 @@ _git_log ()\n>  \t\t\t--relative-date --date=\n>  \t\t\t--author= --committer= --grep=\n>  \t\t\t--all-match\n> -\t\t\t--pretty= --name-status --name-only --raw\n> +\t\t\t--pretty=\n>  \t\t\t--not --all\n>  \t\t\t--left-right --cherry-pick\n>  \t\t\t--graph\n> -\t\t\t--stat --numstat --shortstat\n> -\t\t\t--decorate --diff-filter=\n> -\t\t\t--color-words --walk-reflogs\n> +\t\t\t--decorate\n> +\t\t\t--walk-reflogs\n>  \t\t\t--parents --children --full-history\n>  \t\t\t--merge\n>  \t\t\t--inter-hunk-context=\n> -\t\t\t--patience\n> +\t\t\t$__git_diff_common_options\n>  \t\t\t--pickaxe-all --pickaxe-regex\n>  \t\t\t\"\n\nI'll tweak this part to drop duplicated --ihc; other than that it looked\ngood.  Thanks.\n"}]}