git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* What should a user expect from git log -M -- file
@ 2009-11-26 16:36 Mike Hommey
  2009-11-26 17:14 ` Jakub Narebski
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Hommey @ 2009-11-26 16:36 UTC (permalink / raw)
  To: git

Hi,

I recently reorganized a project of mine, and the result is that a lot of
files moved from the top directory to a sub directory.

Now, I innocently tried to 'git log -M' some of these files in the
subdirectories, and well, the history just stops when the file was
created. Obviously, if I put both the old and the new location it works,
but shouldn't users expect 'git log -M -- file' to try to find the
previous path and continue from there ?

Mike

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: What should a user expect from git log -M -- file
  2009-11-26 16:36 What should a user expect from git log -M -- file Mike Hommey
@ 2009-11-26 17:14 ` Jakub Narebski
  2009-11-27  7:28   ` Mike Hommey
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Narebski @ 2009-11-26 17:14 UTC (permalink / raw)
  To: Mike Hommey; +Cc: git

Mike Hommey <mh@glandium.org> writes:

> I recently reorganized a project of mine, and the result is that a lot of
> files moved from the top directory to a sub directory.
> 
> Now, I innocently tried to 'git log -M' some of these files in the
> subdirectories, and well, the history just stops when the file was
> created. Obviously, if I put both the old and the new location it works,
> but shouldn't users expect 'git log -M -- file' to try to find the
> previous path and continue from there ?

What you want is not

  git log -M -- file

but

  git log --follow file

"git log -M -- file" IIRC first applies path limiting, simplifying
history, *then* does rename detection, and finally filters output
(unless --full-diff is used).

-- 
Jakub Narebski
Poland
ShadeHawk on #git

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: What should a user expect from git log -M -- file
  2009-11-26 17:14 ` Jakub Narebski
@ 2009-11-27  7:28   ` Mike Hommey
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Hommey @ 2009-11-27  7:28 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git

On Thu, Nov 26, 2009 at 09:14:37AM -0800, Jakub Narebski wrote:
> Mike Hommey <mh@glandium.org> writes:
> 
> > I recently reorganized a project of mine, and the result is that a lot of
> > files moved from the top directory to a sub directory.
> > 
> > Now, I innocently tried to 'git log -M' some of these files in the
> > subdirectories, and well, the history just stops when the file was
> > created. Obviously, if I put both the old and the new location it works,
> > but shouldn't users expect 'git log -M -- file' to try to find the
> > previous path and continue from there ?
> 
> What you want is not
> 
>   git log -M -- file
> 
> but
> 
>   git log --follow file
> 
> "git log -M -- file" IIRC first applies path limiting, simplifying
> history, *then* does rename detection, and finally filters output
> (unless --full-diff is used).

That's what I was looking for, thanks. I would suggest to put --follow
closer to -M and -C in the documentation, but the way the git-log
manual is generated (including diff options) makes that impossible :(

Mike

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-27  7:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-26 16:36 What should a user expect from git log -M -- file Mike Hommey
2009-11-26 17:14 ` Jakub Narebski
2009-11-27  7:28   ` Mike Hommey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).