Re: [PATCH v3 18/20] completion: support `git range-diff`

2 messages, 2 authors, 2018-07-07 · open the first message on its own page

Re: [PATCH v3 18/20] completion: support `git range-diff`

From: Junio C Hamano <hidden>
Date: 2018-07-06 22:46:24

"Johannes Schindelin via GitGitGadget" [off-list ref]
writes:
From: Johannes Schindelin <redacted>

Tab completion of `git range-diff` is very convenient, especially
given that the revision arguments to specify the commit ranges to
compare are typically more complex than, say, your grandfather's `git
log` arguments.

Signed-off-by: Johannes Schindelin <redacted>
Have three-dash lines here, or perhaps have some validation hook in
the garden-shears tool to notice these leftoer bits we see below?
quoted hunk
squash! WIP completion: support `git range-diff`

Revert "WIP completion: support `git range-diff`"

This reverts commit 2e7af652af9e53a19fd947f8ebe37a78043afa49.
---
 contrib/completion/git-completion.bash | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 94c95516e..402490673 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1976,6 +1976,20 @@ _git_push ()
 	__git_complete_remote_or_refspec
 }
 
+_git_range_diff ()
+{
+  case "$cur" in
+  --*)
+          __gitcomp "
+	  	--creation-factor= --dual-color
+                  $__git_diff_common_options
+                  "
+          return
+          ;;
+  esac
+  __git_complete_revlist
+}
+
 _git_rebase ()
 {
 	__git_find_repo_path

Re: [PATCH v3 18/20] completion: support `git range-diff`

From: Johannes Schindelin <hidden>
Date: 2018-07-07 11:39:15

Hi Junio,

On Fri, 6 Jul 2018, Junio C Hamano wrote:
"Johannes Schindelin via GitGitGadget" [off-list ref]
writes:
quoted
From: Johannes Schindelin <redacted>

Tab completion of `git range-diff` is very convenient, especially
given that the revision arguments to specify the commit ranges to
compare are typically more complex than, say, your grandfather's `git
log` arguments.

Signed-off-by: Johannes Schindelin <redacted>
Have three-dash lines here, or perhaps have some validation hook in
the garden-shears tool to notice these leftoer bits we see below?
This is just a simple case of me overlooking the `squash!` while rebasing.
The shears were not involved, as it is not a branch thicket, it is a
simple, linear branch.

I guess I could install some sort of post-rewrite hook, but then, I'd
rather have this as a more generally useful feature, directly in `rebase
-i`: if running in autosquash mode, when offering to edit squashed commit
messages, `git rebase -i` should refuse by default to accept a commit
message that contains a line that starts with `squash! `.

Would make for a nice micro-project, methinks.
quoted
squash! WIP completion: support `git range-diff`

Revert "WIP completion: support `git range-diff`"

This reverts commit 2e7af652af9e53a19fd947f8ebe37a78043afa49.
---
I will fix this in my branch, of course, and force-push, but will wait
with sending out a new revision of the patch series in case more reviews
roll in.

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help