From: Linus Torvalds Date: Fri, 24 Jun 2005 16:43:12 GMT Subject: Re: rev-parse, unknown arguments and extended sha1's Message-ID: In-Reply-To: <20050624161718.GA14909@pc117b.liacs.nl> On Fri, 24 Jun 2005, Sven Verdoolaege wrote: > > This is what I use: > > rev2=`echo $rev | sed -e 's/[^0-9a-f]//'` > rev3=`echo $rev2 | sed -e 's/........................................//'` > if test "x$rev3" = "x" -a "x$rev" = "x$rev2"; then > echo "valid SHA1" > fi Oooh. UGGHLEE. This is one reason I don't do much shell. Anyway, I think I'll make git-rev-parse have some option to "error out if the result is anything but a single revision number", since this is really the only reason for git-rev-parse in the first place: to make readable scripts. Linus