Skip to contentSkip to conversation

nit: missing branch error message

DISCUSSION Jeff Garzik 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Just tried accidentally to check out a non-existent branch:

Quoted 7 lines

[jgarzik@pretzel libata-dev]$ git checkout -f upstream
fatal: Needed a single revision

[jgarzik@pretzel libata-dev]$ ls .git/refs/heads/

adma      chs-support  master    pata-drivers       sil24-original  vsc-mwi
adma-mwi  iomap        ncq       promise-sata-pata  sil-lbt
ALL       iomap-step1  passthru  sil24              upstream-fixes

Better error message would be "hey dummy, branch doesn't exist"

Jeff

#1 lore raw
Quoted 4 lines · Jeff Garzik
Quoted 2 lines

[jgarzik@pretzel libata-dev]$ git checkout -f upstream
fatal: Needed a single revision

Better error message would be "hey dummy, branch doesn't exist"

Thanks.

#2 lore raw
Quoted 8 lines · Junio C Hamano
Quoted 4 lines · Jeff Garzik
Quoted 2 lines

[jgarzik@pretzel libata-dev]$ git checkout -f upstream
fatal: Needed a single revision

Better error message would be "hey dummy, branch doesn't exist"

Thanks.

Hell no.

I'm pissed.

	[torvalds@g5 linux]$ git checkout -b st-5481 0677b284b827fbac20961037982f2a6459a827a8
	hey dummy, branch '0677b284b827fbac20961037982f2a6459a827a8' doesn't exist.

This f*cking message needs to go! The old message may have been confused, but it was confused for a really good reason. The new message shows that you didn't understand what "git checkout" does.

Linus