Re: should git rev-parse -q --verify on a range produce output?

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

 



demerphq <demerphq@xxxxxxxxx> writes:

> I was curious if it is a bug that `rev-parse -q --verify` produces
> output for a commit range, and only reveals it is supposed to be used
> with a single commit as an error message?

I know that the original scenario that the combination of "--verify"
and "--quiet" was invented for was "I have a string that ought to
resolve to a single object name, but the object may be missing", and

	if git cat-file -e "$name" 2>/dev/null
	then
		rawname=$(git rev-parse --verify "$name")
		true
	else
		false
	fi &&
	... do something that uses $rawname here ...
	
is a mouthful.  It becomes easier to use if we can say

	rawname=$(git rev-parse -q --verify "$name") &&
	... do something that uses $rawname here ...

I do not think the behaviour in usecase outside that was carefully
designed to the details.



[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]

  Powered by Linux