git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Hommey <mh@glandium.org>
To: Jakub Narebski <jnareb@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: What should a user expect from git log -M -- file
Date: Fri, 27 Nov 2009 08:28:20 +0100	[thread overview]
Message-ID: <20091127072820.GA17045@glandium.org> (raw)
In-Reply-To: <m3ocmpmcoq.fsf@localhost.localdomain>

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

      reply	other threads:[~2009-11-27  7:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091127072820.GA17045@glandium.org \
    --to=mh@glandium.org \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).