Re: svn versus git

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

 



Andy Parkins wrote:

> 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.

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

> $ 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


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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