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

Re: svn versus git

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 15, 2006, 11:27 UTC
Message-ID
<elu0n5$u0i$1@sea.gmane.org>
In-Reply-To
<200612140908.36952.andyparkins@gmail.com>
Andy Parkins wrote:
Show 11 quoted lines
> On Wednesday 2006 December 13 22:56, Shawn Pearce wrote:
> 
>>   git cat-file -p $REV:$file
>>
>> not sure how much easier it gets than that.  Load in the bash
>> completion from contrib/completion and you can even tab complete
>> the $file part.
> 
> Yes.  I was a little unfair on that one; I forgot about the REV:file syntax.  
> However, it's still not simple for a new user; I think I'd say "draw" if 
> the "-p" weren't a requirement.
  $ git repo-config alias.less "-p cat-file -p"
  $ git repo-config alias.cat     "cat-file -p"
remedies that.
[...]
Show 9 quoted lines
>> How is it unfriendly?  What specifically would you change to make
>> it more friendly?
> 
> $ git-ls-tree v1.0.0
> 100644 blob 906e98492080d2fde9467a9970fc92d7a8cfeaf8    Makefile
> 
> I'm a newbie:  what's that number at the front?  What's a blob?  What's that 
> great big number - I've only seen commit hashes that look like that, and that 
> isn't one.  Definitely not friendly.

The number in front is octal mode of a file or directory. "blob" is a file (or symbolic link), "tree" is a directory, all of this can be found in git(7).

The "great big number" is blob hash. All objects are identified and referenced by SHA-1 hash of its contents: be it commits, blobs (contents of a file), trees (content of a directory), tags.

You can always use --abbrev option to have it shortened.
Show 5 quoted lines
> $ svn list -r 14
> Makefile
> 
> It could probably be fixed by making git-ls-files capable of understanding 
> tree-ish.

Perhaps we should add git-ls which would be porcelain frontend to git-ls-files and git-ls-tree, just like git-diff is frontend to git-diff-files, git-diff-index and git-diff-tree (and also does pure blob diff).

"svn list -r 14" equivalent is "git ls-tree --name-only v1.0.0". You can always do

  $ git repo-config alias.list "ls-tree --name-only"
(or use --name-status instead of --name-only).
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Previous: Nguyen Thai Ngoc DuyNext: Andy Parkins
Message 30 of 43 in “svn versus git”
  1. Andy ParkinsDec 13, 2006
  2. J. Bruce FieldsDec 13, 2006
  3. Document the simple way of using of git-cat-fileRobin Rosenberg, Dec 13, 2006
  4. Jakub NarebskiDec 13, 2006
  5. Johannes SchindelinDec 14, 2006
  6. Jakub NarebskiDec 14, 2006
  7. Jakub NarebskiDec 13, 2006
  8. Andy ParkinsDec 13, 2006
  9. Jakub NarebskiDec 13, 2006
  10. Shawn PearceDec 13, 2006
  11. Peter BaumannDec 13, 2006
  12. Shawn PearceDec 13, 2006
  13. Jakub NarebskiDec 13, 2006
  14. Shawn PearceDec 13, 2006
  15. Andy ParkinsDec 14, 2006
  16. Junio C HamanoDec 14, 2006
  17. Andy ParkinsDec 14, 2006
  18. Nguyen Thai Ngoc DuyDec 14, 2006
  19. Johannes SchindelinDec 14, 2006
  20. Nguyen Thai Ngoc DuyDec 14, 2006
  21. Johannes SchindelinDec 14, 2006
  22. Nguyen Thai Ngoc DuyDec 14, 2006
  23. Johannes SchindelinDec 15, 2006
  24. Nguyen Thai Ngoc DuyDec 15, 2006
  25. Johannes SchindelinDec 15, 2006
  26. Johannes SchindelinDec 15, 2006
  27. Junio C HamanoDec 15, 2006
  28. Nicolas PitreDec 15, 2006
  29. Nguyen Thai Ngoc DuyDec 16, 2006
  30. Jakub NarebskiDec 15, 2006
  31. Andy ParkinsDec 15, 2006
  32. Seth FalconDec 14, 2006
  33. Jakub NarebskiDec 15, 2006
  34. Robin RosenbergDec 13, 2006
  35. Junio C HamanoDec 13, 2006
  36. Andy ParkinsDec 14, 2006
  37. Arkadiusz MiskiewiczDec 14, 2006
  38. Andreas EricssonDec 14, 2006
  39. Arkadiusz MiskiewiczDec 14, 2006
  40. Shawn PearceDec 14, 2006
  41. Andreas EricssonDec 15, 2006
  42. Johannes SchindelinDec 14, 2006
  43. Jakub NarebskiDec 15, 2006

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.