git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: rev-parse, unknown arguments and extended sha1's

From
SVSven Verdoolaege <skimo@liacs.nl>
Date
Jun 24, 2005, 16:17 UTC
Message-ID
<20050624161718.GA14909@pc117b.liacs.nl>
In-Reply-To
<Pine.LNX.4.58.0506240904240.11175@ppc970.osdl.org>
On Fri, Jun 24, 2005 at 09:09:23AM -0700, Linus Torvalds wrote:
> Anyway, add the --revs-only, and the test against empty should make a bit 
> more sense. In fact, it _should_ test that it's a SHA1 (and not a rev 
> argument), but I couldn't come up with a good way to test that in shell.
> 
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
skimo
Previous: Linus TorvaldsNext: Linus Torvalds
Message 3 of 5 in “rev-parse, unknown arguments and extended sha1's”
  1. Sven VerdoolaegeJun 24, 2005
  2. Linus TorvaldsJun 24, 2005
  3. Sven VerdoolaegeJun 24, 2005
  4. Linus TorvaldsJun 24, 2005
  5. Linus TorvaldsJun 24, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.