git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: wh <microrffr@gmail.com>
To: git@vger.kernel.org
Subject: [BUG] rebase --interactive silently overwrites ignored files
Date: Thu, 11 Apr 2019 16:56:09 -0700	[thread overview]
Message-ID: <CAL_tzDGRQ4BzJ4c6QypXfBXQNQYocbKbJSBOHhBBB2TwQQPCGA@mail.gmail.com> (raw)

I'm using git 2.20.1 from Debian. Git is usually careful not to
overwrite untracked files, including ignored files. But interactive
rebase doesn't detect this (non-interactive rebase works fine).

Reproduction:
-----

#!/bin/sh
mkdir upstream
cd upstream
git init
echo 1 >feature-1
git add feature-1
git commit -m "feature 1"

cd ..
git clone upstream local
cd local
# write some tools for our own convenience
echo ours >tools
echo /tools >>.git/info/exclude
# start working on a feature
git checkout -b f2
echo wip >feature-2
git add feature-2
git commit -m "wip"

cd ../upstream
# official tools are available
echo theirs >tools
git add tools
git commit -m "tools"

cd ../local
git fetch ../upstream master

# this would be okay
#git rebase FETCH_HEAD

# problem: overwrites tools silently
GIT_EDITOR=true git rebase -i FETCH_HEAD

cat tools

-----

Expected: `git rebase -i` fails because it would have to overwrite the
untracked "tools" file. Contents of tools file remains `ours`.

Actual: Contents of tools file becomes `theirs`.

             reply	other threads:[~2019-04-11 23:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11 23:56 wh [this message]
2019-04-12 16:30 ` [BUG] rebase --interactive silently overwrites ignored files Phillip Wood
2019-04-14  1:59   ` wh
2019-04-14 13:24     ` Phillip Wood
2019-05-02 15:45     ` Phillip Wood
2019-05-02 16:22       ` Duy Nguyen
2019-05-05  4:02       ` Junio C Hamano
2019-05-07 14:03         ` Phillip Wood

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=CAL_tzDGRQ4BzJ4c6QypXfBXQNQYocbKbJSBOHhBBB2TwQQPCGA@mail.gmail.com \
    --to=microrffr@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).