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

Re: Disappearing change on pull rebase

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Nov 11, 2011, 06:56 UTC
Message-ID
<4EBCC71D.6000505@viscovery.net>
In-Reply-To
<3FF1328CB05DB74898F769F1BA17812C3E49B74699@GVW1348EXA.americas.hpqcorp.net>
Am 11/10/2011 14:35, schrieb Pitucha, Stanislaw Izaak:
Show 10 quoted lines
> As mentioned in the original mail - the merge commit did have changes.
> Here's the log of reproducing it. The line containing "2" in changelog
> is gone from master after pull --rebase.
> ...
> disappearing_commit$ git merge --no-ff --no-commit some-branch
> Automatic merge went well; stopped before committing as requested
> disappearing_commit$ echo 2 >> changelog 
> disappearing_commit$ git add changelog
> disappearing_commit$ git commit
> [master e41e4c9] Merge branch 'some-branch'

This is by design. Rebase does not rebase merge commits because it is assumed that merge commits only do what their name implies - to merge branches of a forked history. As such, they do not introduce their own changes. Follow this rule, i.e., make your change in a separate non-merge commit, and you are fine.

-- Hannes
Previous: Pitucha, Stanislaw IzaakNext: Philippe Vaucher
Message 4 of 8 in “Disappearing change on pull rebase”
  1. Pitucha, Stanislaw IzaakNov 10, 2011
  2. Kirill LikhodedovNov 10, 2011
  3. Pitucha, Stanislaw IzaakNov 10, 2011
  4. Johannes SixtNov 11, 2011
  5. Philippe VaucherNov 11, 2011
  6. Johannes SixtNov 11, 2011
  7. Philippe VaucherNov 11, 2011
  8. Junio C HamanoNov 11, 2011

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.