git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Sitaram Chamarty <sitaramc@gmail.com>
To: git@vger.kernel.org
Subject: bug? 'git log -M100' is different from 'git log -M100%'
Date: Tue, 18 Dec 2012 05:04:46 +0530	[thread overview]
Message-ID: <20121217233446.GA5987@sita-lt.atc.tcs.com> (raw)

Hi,

When using -M with a number to act as a threshold for declaring
a change as being a rename, I found a... quirk.  Any 2-digit
number after the M will work, but if the number is 100, it will
require a % to be appended to be effective.

Here's a transcript that will demonstrate the problem when run
in an empty directory.

    # setup
    git init
    seq 1 100 > f1
    git add f1
    git commit -m f1
    git rm f1
    ( seq 1 45; seq 1001 1010; seq 56 100 ) > f2
    git add f2
    git commit -m f2

    # here's the buglet

    git log -1 --stat --raw -M
    # this tells you the files are 83% similar

    git log -1 --stat --raw -M82
    # this shows it like a rename

    git log -1 --stat --raw -M83
    # this also

    git log -1 --stat --raw -M84
    # this shows two separate files

    git log -1 --stat --raw -M99
    # this also

    # so far so good...

    git log -1 --stat --raw -M100
    # but this shows it like a rename

    git log -1 --stat --raw -M100%
    # adding a percent sign fixes it, now they're two separate
    # files.  It seems to be required only when you ask for 100%

-- 
Sitaram Chamarty

             reply	other threads:[~2012-12-18  0:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-17 23:34 Sitaram Chamarty [this message]
2012-12-18  1:25 ` bug? 'git log -M100' is different from 'git log -M100%' Junio C Hamano
2012-12-18  4:17   ` Sitaram Chamarty

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20121217233446.GA5987@sita-lt.atc.tcs.com \
    --to=sitaramc@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).