From: Jeff King Date: Thu, 21 Mar 2013 13:26:20 GMT Subject: Re: Which file is older in history? Message-ID: <20130321132620.GB23162@sigill.intra.peff.net> In-Reply-To: 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 - is deprecated in favor of tail -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. -Peff