Re: Re: git log -M -- filename is not working?
- From
Jeff King <peff@peff.net>
- Date
- May 8, 2010, 04:44 UTC
- Message-ID
- <20100508044434.GC14998@coredump.intra.peff.net>
- In-Reply-To
- <19428.24021.324557.517627@winooski.ccs.neu.edu>
On Fri, May 07, 2010 at 02:37:09PM -0400, Eli Barzilay wrote:
> BTW, I've had at least 4 people now who got confused by this. Is > there any use for -M/-C without --follow? In any case, it will be > very helpful if the -M/-C descriptions said "see also --follow".
Yes, it detects renames when doing diffs.
Documentation patch is below.
> Also, is there a way to set this as the default for `git log'?
If you mean --follow, then no. Nor would you probably want to, because the --follow mechanism (as currently implemented) is pretty restricted. It can only take a single path currently.
-- >8 -- Subject: [PATCH] docs: clarify meaning of -M for git-log
As an option to the "diff" family, it is fairly obvious what "detect renames" means. However, for revision traversal, the "-M" option is just included in the long list of options, with no indication that it is about showing renames in diffs versus following renames. Let's make it more explicit.
Signed-off-by: Jeff King <peff@peff.net> --- The only other revision traversal manpage that includes diff-options seems to be format-patch. Should it get the same treatment?
Documentation/diff-options.txt | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index c9c6c2b..3070ddd 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -177,7 +177,14 @@ endif::git-format-patch[] Break complete rewrite changes into pairs of delete and create. -M:: +ifndef::git-log[] Detect renames. +endif::git-log[] +ifdef::git-log[] + If generating diffs, detect and report renames for each commit. + For following files across renames while traversing history, see + `--follow`. +endif::git-log[] -C:: Detect copies as well as renames. See also `--find-copies-harder`.
-- 1.7.1.176.gcff095.dirty