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

Re: [RFC] git rebase -s ours

From
Jeff King <peff@peff.net>
Date
Mar 2, 2008, 01:05 UTC
Message-ID
<20080302010527.GB22843@coredump.intra.peff.net>
In-Reply-To
<20080301111716.GA3263@glandium.org>
On Sat, Mar 01, 2008 at 12:17:16PM +0100, Mike Hommey wrote:
> What do you think git rebase -s ours should be considering as "ours"?
> If I'm not mistaken, at the moment, "ours" stands for "upstream", which
> is kind of confusing...

Sort of. It actually works as "what is in the working tree is fine" so it ends up not applying _any_ commits. In other words,

  git rebase --strategy=ours upstream
is equivalent to
  git reset --hard upstream

So I think the current behavior is nonsensical, and I assume nobody uses it.

OTOH, what exactly are you trying to accomplish? If you have "ours" mean "always take the rebased content", then aren't you stomping on original commits? You might mean something like "do a regular 3-way merge, and for every textual conflict, choose the rebased content". That at least makes some sense, but I suspect it will produce uncompilable results in most cases.

What I am getting at is: what 'ours' should mean in a rebase depends on how it can usefully be used in a workflow. Do you have a workflow in mind?

-Peff
Previous: Mike HommeyNext: Mike Hommey
Message 2 of 7 in “[RFC] git rebase -s ours”
  1. Mike HommeyMar 1, 2008
  2. Jeff KingMar 2, 2008
  3. Mike HommeyMar 2, 2008
  4. Jeff KingMar 3, 2008
  5. Mike HommeyMar 3, 2008
  6. Jeff KingMar 3, 2008
  7. Mike HommeyMar 3, 2008

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.