Re: [PATCH v2] completion: Add '--edit-todo' to rebase

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Quoting Thomas Braun <thomas.braun@xxxxxxxxxxxxxxxxxxx>:

Signed-off-by: Thomas Braun <thomas.braun@xxxxxxxxxxxxxxxxxxx>
---
John Keeping <john@xxxxxxxxxxxxx> hat am 13. Juli 2015 um 15:11 geschrieben:
git-rebase.sh contains:

	if test "$action" = "edit-todo" && test "$type" != "interactive"
	then
		die "$(gettext "The --edit-todo action can only be used during interactive
rebase.")"
	fi

I wonder if it's worth doing a similar check here, which presumably
means testing if "$dir"/interactive exists.

Good point. Thanks for the hint.

Perhaps the subject line could say "completion: offer '--edit-todo' during interactive rebase" to be a bit more specific.

contrib/completion/git-completion.bash | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/contrib/completion/git-completion.bash
b/contrib/completion/git-completion.bash
index c97c648..b03050e 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1668,7 +1668,11 @@ _git_rebase ()
{
	local dir="$(__gitdir)"
	if [ -d "$dir"/rebase-apply ] || [ -d "$dir"/rebase-merge ]; then
-		__gitcomp "--continue --skip --abort"
+		if [ -d "$dir"/interactive ]; then

This doesn't work for me, I think it looks for the right file at the wrong place. During an interactive rebase I have no '.git/interactive' file but a '.git/rebase-merge/interactive', so I never get '--edit-todo'.

After some playing around and a cursory look at the source it seems to me that I have '.git/rebase-apply' during a "regular" rebase and '.git/rebase-merge' during an interactive rebase, and git-rebase.sh checks the presence of the 'interactive' file only in '.git/rebase-merge'. It's not clear to me yet whether it's possible to have a '.git/rebase-merge' without the file 'interactive' in it. If it is possible, then I'd like to know with which commands and under what circumstances. If it isn't, then we wouldn't have to look for the file at all, because checking the presence of the directory would be enough.


Best,
Gábor

+			__gitcomp "--continue --skip --abort --edit-todo"
+		else
+			__gitcomp "--continue --skip --abort"
+		fi
		return
	fi
	__git_complete_strategy && return
--
2.4.5.windows.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]