git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bryan Turner <bturner@atlassian.com>
To: Git Users <git@vger.kernel.org>
Subject: Rebase-via-merge behavior difference between Linux and Windows
Date: Tue, 31 Mar 2020 16:24:28 -0700	[thread overview]
Message-ID: <CAGyf7-FUjCefwGjvCcwmjO=GADd5S0cU_=S_tVy4nMaj07+rQA@mail.gmail.com> (raw)

With the default rebase backend changing from "apply" to "merge" in
2.26, I've seen several threads about behavior changes between the two
backends. This is _not_ one of those (although, as I mention at the
end, the "apply" backend doesn't appear to have this issue).

Instead, what I'm observing is a behavior difference between the same
"merge" backend depending on whether the command is run on Linux or
Windows.

A little context: Bitbucket Server has a set of zipped repositories
that provide consistent initial state, and we have tests that download
those zips and then run various Git commands against them and verify
we get expected outcomes. These same tests run on both Windows and
Linux.

Using our merge test repository[1], one such test performs the following steps:
* Unzip bare repository
* `git clone --shared -b branch_that_differ_by_empty_commit_trgt
<unzipped> rebase-test`
* `git rebase -q --no-verify 7549846524f8aed2bd1c0249993ae1bf9d3c9998
298924b8c403240eaf89dcda0cce7271620ab2f6`

298924b8c40 is an empty commit (i.e. `git commit --allow-empty`), and
is the only commit not already reachable from 7549846524f.

On Linux, when this test completes, "HEAD" in "rebase-test" is
7549846524f because the empty commit was discarded. This is the
expected behavior. On Windows, "HEAD" is a new empty commit, which
causes our test to fail.

If I set "rebase.backend=apply" on the "git rebase" command, I once
again get identical behavior on both platforms, with the empty commit
discarded. (I'm just noting this in case it's relevant.)

[1] https://packages.atlassian.com/maven-public-local/com/atlassian/stash/git/merge/2.9/merge-2.9.zip

             reply	other threads:[~2020-03-31 23:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-31 23:24 Bryan Turner [this message]
2020-04-01  6:35 ` Rebase-via-merge behavior difference between Linux and Windows Elijah Newren
2020-04-02  1:15   ` Bryan Turner
2020-04-02  3:02     ` Elijah Newren

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='CAGyf7-FUjCefwGjvCcwmjO=GADd5S0cU_=S_tVy4nMaj07+rQA@mail.gmail.com' \
    --to=bturner@atlassian.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).