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

[PATCH 5/5] hg-to-git: use git rev-parse instead of git show

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Jul 6, 2008, 03:15 UTC
Message-ID
<d93e9bf965d52f749c8bf63afb73815043ebf88d.1215313871.git.vmiklos@frugalware.org>
In-Reply-To
<b9e0cd170819882800fe1f0def7ac740a3176a7b.1215313871.git.vmiklos@frugalware.org>

'show' is a high-level command, scripts are better if they use 'rev-parse'.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---
 contrib/hg-to-git/hg-to-git.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/contrib/hg-to-git/hg-to-git.py b/contrib/hg-to-git/hg-to-git.py
index 7b03204..0ecb38b 100755
--- a/contrib/hg-to-git/hg-to-git.py
+++ b/contrib/hg-to-git/hg-to-git.py
@@ -233,7 +233,7 @@ for cset in range(int(tip) + 1):
         os.system('git branch -d %s' % otherbranch)
 
     # retrieve and record the version
-    vvv = os.popen('git show --quiet --pretty=format:%H').read()
+    vvv = os.popen('git rev-parse HEAD').read()
     print 'record', cset, '->', vvv
     hgvers[str(cset)] = vvv
 
-- 
1.5.6.1.322.ge904b.dirty
Previous: Miklos Vajna
Message 6 of 6 in “hg-to-git fixes”
  1. 0/5 hg-to-git fixesMiklos Vajna, Jul 6, 2008
  2. 1/5 hg-to-git: avoid raising a string exceptionMiklos Vajna, Jul 6, 2008
  3. 2/5 hg-to-git: abort if the project directory is not a hg repoMiklos Vajna, Jul 6, 2008
  4. 3/5 hg-to-git: rewrite "git-frotz" to "git frotz"Miklos Vajna, Jul 6, 2008
  5. 4/5 hg-to-git: use git init instead of git init-dbMiklos Vajna, Jul 6, 2008
  6. 5/5 hg-to-git: use git rev-parse instead of git showMiklos Vajna, Jul 6, 2008

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.