git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Aborting 'rebase main feat' removes unversioned files

From
FBFedor Biryukov <fedor.birjukov@gmail.com>
Date
Sep 4, 2021, 09:51 UTC
Message-ID
<CAG2t84Xe2XwdwdAK42bRrwAeNaB3-A+WhgSsJGOoW9-rG1S9Xg@mail.gmail.com>
In-Reply-To
<YTNA6Qo6Yj5o9NmQ@coredump.intra.peff.net>

There is no way this could be the intended behavior, but the good news is that I cannot reproduce it... Looks like it occurs only in one git version (2.31.0.windows.1, IIRC). And it does not occur in the latest git version: git version 2.33.0.windows.2.

-Fedor
On Sat, Sep 4, 2021 at 11:48 AM Jeff King <peff@peff.net> wrote:
Show 43 quoted lines
>
> On Sat, Sep 04, 2021 at 01:57:11PM +0700, Bagas Sanjaya wrote:
>
> > On 04/09/21 03.33, Fedor Biryukov wrote:
> > > Looks like a bug in git rebase main feat.
> > >
> > > To reproduce:
> > > git init
> > > git commit -m 'init' --allow-empty
> > > git checkout -b feat
> > > echo 123 > readme.txt
> > > git add readme.txt
> > > git commit -m 'txt=123'
> > > git checkout main
> > > echo 012 > readme.txt
> > > git rebase main feat
> > > git rebase --abort
> > >
> >
> > Did you forget committing?
>
> I don't think so.
>
> The point is that "readme.txt" is not a tracked file on the main branch,
> and thus Git should consider it precious.
>
> I don't think the "rebase --abort" is the problem here, though. It's the
> command before:
>
>   git rebase main feat
>
> The "feat" branch is already ahead of "main" (which has no new commits),
> and so it just says:
>
>   Current branch feat is up to date.
>
> and leaves us on the "feat" branch. But in doing so, it overwrites the
> precious untracked content in the working tree.
>
> The "git rebase --abort" command then does nothing, because there's no
> rebase in progress.
>
> -Peff
Previous: Jeff KingNext: Fedor Biryukov
Message 4 of 15 in “Aborting 'rebase main feat' removes unversioned files”
  1. Fedor BiryukovSep 3, 2021
  2. Bagas SanjayaSep 4, 2021
  3. Jeff KingSep 4, 2021
  4. Fedor BiryukovSep 4, 2021
  5. Fedor BiryukovSep 4, 2021
  6. Fedor BiryukovSep 4, 2021
  7. Jeff KingSep 4, 2021
  8. Fedor BiryukovSep 4, 2021
  9. Jeff KingSep 4, 2021
  10. Elijah NewrenSep 5, 2021
  11. Ævar Arnfjörð BjarmasonSep 5, 2021
  12. Fedor BiryukovSep 5, 2021
  13. Elijah NewrenSep 8, 2021
  14. Junio C HamanoSep 5, 2021
  15. Elijah NewrenSep 8, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.