git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] bash: offer refs for 'git bisect start'
@ 2010-10-10 21:39 SZEDER Gábor
  2010-10-10 21:39 ` [PATCH 2/2] bash: not all 'git bisect' subcommands make sense when not bisecting SZEDER Gábor
  0 siblings, 1 reply; 5+ messages in thread
From: SZEDER Gábor @ 2010-10-10 21:39 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Junio C Hamano, git, SZEDER Gábor

The completion script only offered path completion after 'git bisect
start', although bad and good refs could also be specified before the
doubledash.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
 contrib/completion/git-completion.bash |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 6756990..eb8ef47 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -912,7 +912,7 @@ _git_bisect ()
 	fi
 
 	case "$subcommand" in
-	bad|good|reset|skip)
+	bad|good|reset|skip|start)
 		__gitcomp "$(__git_refs)"
 		;;
 	*)
-- 
1.7.3.1.148.g2fffa

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] bash: not all 'git bisect' subcommands make sense when not bisecting
  2010-10-10 21:39 [PATCH 1/2] bash: offer refs for 'git bisect start' SZEDER Gábor
@ 2010-10-10 21:39 ` SZEDER Gábor
  2010-10-10 22:05   ` Sverre Rabbelier
  0 siblings, 1 reply; 5+ messages in thread
From: SZEDER Gábor @ 2010-10-10 21:39 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Junio C Hamano, git, SZEDER Gábor

... but only 'start' and 'replay'.  The other commands will either
error out or offer to start bisecting for the user.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
---
 contrib/completion/git-completion.bash |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index eb8ef47..1262f72 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -907,7 +907,11 @@ _git_bisect ()
 	local subcommands="start bad good skip reset visualize replay log run"
 	local subcommand="$(__git_find_on_cmdline "$subcommands")"
 	if [ -z "$subcommand" ]; then
-		__gitcomp "$subcommands"
+		if [ -f "$(__gitdir)"/BISECT_START ]; then
+			__gitcomp "$subcommands"
+		else
+			__gitcomp "replay start"
+		fi
 		return
 	fi
 
-- 
1.7.3.1.148.g2fffa

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] bash: not all 'git bisect' subcommands make sense when not bisecting
  2010-10-10 21:39 ` [PATCH 2/2] bash: not all 'git bisect' subcommands make sense when not bisecting SZEDER Gábor
@ 2010-10-10 22:05   ` Sverre Rabbelier
  2010-10-10 22:12     ` SZEDER Gábor
  0 siblings, 1 reply; 5+ messages in thread
From: Sverre Rabbelier @ 2010-10-10 22:05 UTC (permalink / raw)
  To: SZEDER Gábor; +Cc: Shawn O. Pearce, Junio C Hamano, git

Heya,

On Sun, Oct 10, 2010 at 23:39, SZEDER Gábor <szeder@ira.uka.de> wrote:
> ... but only 'start' and 'replay'.  The other commands will either
> error out or offer to start bisecting for the user.

I'm not sure, following the same concept "git rebase" should not offer
"--continue" if you're not rebasing. It might just be frustrating for
the user since they might not realize they're not bisecting yet.

-- 
Cheers,

Sverre Rabbelier

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] bash: not all 'git bisect' subcommands make sense when not bisecting
  2010-10-10 22:05   ` Sverre Rabbelier
@ 2010-10-10 22:12     ` SZEDER Gábor
  2010-10-10 22:14       ` Sverre Rabbelier
  0 siblings, 1 reply; 5+ messages in thread
From: SZEDER Gábor @ 2010-10-10 22:12 UTC (permalink / raw)
  To: Sverre Rabbelier; +Cc: Shawn O. Pearce, Junio C Hamano, git

Hi,

On Mon, Oct 11, 2010 at 12:05:52AM +0200, Sverre Rabbelier wrote:
> Heya,
> 
> On Sun, Oct 10, 2010 at 23:39, SZEDER Gábor <szeder@ira.uka.de> wrote:
> > ... but only 'start' and 'replay'.  The other commands will either
> > error out or offer to start bisecting for the user.
> 
> I'm not sure, following the same concept "git rebase" should not offer
> "--continue" if you're not rebasing.

Actually, my patch follows the same concept of 'git rebase', because
that's exactly what the completion function for 'git rebase' does: it
doesn't offer '--continue' (nor '--abort' and '--skip') if you're not
rebasing.

Best,
Gábor

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] bash: not all 'git bisect' subcommands make sense when not bisecting
  2010-10-10 22:12     ` SZEDER Gábor
@ 2010-10-10 22:14       ` Sverre Rabbelier
  0 siblings, 0 replies; 5+ messages in thread
From: Sverre Rabbelier @ 2010-10-10 22:14 UTC (permalink / raw)
  To: SZEDER Gábor; +Cc: Shawn O. Pearce, Junio C Hamano, git

Heya,

2010/10/11 SZEDER Gábor <szeder@ira.uka.de>:
> Actually, my patch follows the same concept of 'git rebase', because
> that's exactly what the completion function for 'git rebase' does: it
> doesn't offer '--continue' (nor '--abort' and '--skip') if you're not
> rebasing.

Had you only mentioned that in the commit message... ;).

In that case, sounds good!

-- 
Cheers,

Sverre Rabbelier

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-10-10 22:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-10 21:39 [PATCH 1/2] bash: offer refs for 'git bisect start' SZEDER Gábor
2010-10-10 21:39 ` [PATCH 2/2] bash: not all 'git bisect' subcommands make sense when not bisecting SZEDER Gábor
2010-10-10 22:05   ` Sverre Rabbelier
2010-10-10 22:12     ` SZEDER Gábor
2010-10-10 22:14       ` Sverre Rabbelier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).