git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: JuanLeon Lahoz <juanleon.lahoz@gmail.com>
To: git@vger.kernel.org
Subject: Inconsistent results obtained regarding how git decides what commits modifies a given path
Date: Fri, 7 Aug 2015 08:42:52 +0200	[thread overview]
Message-ID: <CANYPdHA6a1Jg2NUJGcg5O3KBG2AB+AK3071ckDywGL=MHghEZA@mail.gmail.com> (raw)

When I use git rev-list (or git log) with the -- option to restrict commits to
those that modify a path, I am getting resuls where I fail to see the
consistency. Worse than that, results vary with git version (pre 1.8.4, results
were consistent; in 1.8.4 or 2.5.0 they don't seem consistent to me, and they
are different than in older versions; I rather like more the pre 1.8.4
behaviour).

Inconsistencies (inside same git version) or differences (across versions)
affects only to merge commits that affect (depending on definition) to a file.

As per manual, "Commits are included if they are not TREESAME to any parent",
but I think I am getting false positives with git versions >= 1.8.4.

Here is an example where I find the results that confuse me:

-------------------------------------------

#!/bin/bash -e
git init
git commit --allow-empty -m initial

# Create four branches, each one enclosing the previous one
echo v1 > version
git add version
git commit -m v1
git branch b1

echo v2 > version
git add version
git commit -m v2
git branch b2

echo v3 > version
git add version
git commit -m v3
git branch b3

echo v4 > version
git add version
git commit -m v4
git branch b4

git tag checkpoint
# We create a couple of merges
git checkout -b b2_3 b2
git merge --no-ff b3

git checkout -b b1_4 b1
git merge --no-ff b4

# This prints nothing on git < 1.8.4; prints a commit that corresponds with
# "Merge branch 'b3' into b2_3" in git >= 1.8.4 (tested with 1.8.4 and 2.5.0)
echo COMMITS checkpoint..b2_3: $(git rev-list checkpoint..b2_3 -- version)
# This prints nothing on any git version I tested.
echo COMMITS checkpoint..b1_4: $(git rev-list checkpoint..b1_4 -- version)

-------------------------------------------

Is that a bug or I am misunderstanding something basic?

Thanks
juanleon

             reply	other threads:[~2015-08-07  6:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-07  6:42 JuanLeon Lahoz [this message]
2015-08-07  8:44 ` Inconsistent results obtained regarding how git decides what commits modifies a given path Jeff King

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='CANYPdHA6a1Jg2NUJGcg5O3KBG2AB+AK3071ckDywGL=MHghEZA@mail.gmail.com' \
    --to=juanleon.lahoz@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.
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).