On Thu, Mar 21, 2013 at 06:02:32PM +0530, Ramkumar Ramachandra wrote:

> >   git log --format=%H --name-status --diff-filter=A -- path1 path2 |
> >   grep ^A |
> >   tail -1
> Great!  I just learnt about --name-status now.

You can also use "--name-only", but the parsing is a little less robust.

> Nit: tail -<n> is deprecated in favor of tail -n <n>, I think.  It's
> nicer to have definite fixed command line options, as opposed to
> parsing an arbitrary -(*) and deciding if \1 is a \d+.

Yeah, POSIX has always specified "-n" for tail, as well as for head.  I
remember in the late 90's and early 00's running into systems where
POSIX "head -n" did not work, and you _had_ to use "head -1". I don't
recall now if that was the case for tail, too, nor what system that was
on (but if I had to guess, I'd say pre-Solaris SunOS).

So yeah. Using "tail -n 1" is probably a better idea in the long run.

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

Reply via email to