Subject: Re: What's in git.git

From: Jakub Narebski <[email-masked]>
Date: Mon, 11 Sep 2006 13:29:19 +0200

Junio C Hamano wrote:

>  - Andy Whitcroft taught send-pack to use git-rev-list --stdin
>    so that we do not have to be limited by the number of refs
>    exec() command-line can hold.
[...]
>  - Pack-objects learned to run rev-list logic internally when
>    given --revs parameter; the refs arguments you would normally
>    give the upstream rev-list can be fed from its standard
>    input, instead of usual list of objects.
BTW. could you please document the above?

Perhaps those two options, --stdin to feed arguments from standard input,
and -revs to run rev-list logic internally should be used whenever possible
in all the git commands? This would allow to avoid forks and/or command
line length limit.
 
In 'next' currently the following commands have --stdin implemented:
 * git-update-index: --stdin to feed list of paths, one per line
 * git-diff-tree: --stdin to loop over <tree-ish>, or pairs of
   <tree-ish>[*1*]
 * git-hash-object: --stdin is equivalent of '-' special file
 * git-http-fetch and git-local-fetch have some strange --stdin
 * git-name-rev with --stdin functions as filter
 * git-rev-list: --stdin to feed list of <commits>; it is not clear from 
   the manpage if one can use ^<commit>, and commit related options
   and shortcuts like --not, <commit>..<commit>, <commit>...<commit>
And the following have --revs implemented
 * git-pack-objects: --revs to provide arguments to rev-list from stdin,
   instead of list of objects. UNDOCUMENTED.

It would be nice if the following commands had --stdin or had it's --stdin
usage extended:
 * git-diff-tree: --stdin to allow to provide path limits, separated 
   by ' -- ' from <tree-ish> or pair of <tree-ish> (does git-diff-tree allow
   for diff3-like behavior? then perhaps also three <tree-ish>)
 * git-ls-tree: --stdin to loop over <tree-ish>, one tree per line.
 * git-cat-object: --stdin to loop over objects, plus -z to change separator
   between records to NULL (or have it turned on by default).
For all "loop" --stdin, the output should begin with the line which was
arguments, like git-diff-tree outputs first <tree-ish> used for diff.

I think it is quite often to use git-rev-list ...| git-diff-tree ...
pipeline, so it might be worth to add --revs option to git-diff-tree.
Or it might not.

P.S. does git-merge take -F <file> option?
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git