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

Re: [RFC PATCH] Teach rebase to rebase even if upstream is up to date with -f

From
Sverre Rabbelier <srabbelier@gmail.com>
Date
Feb 13, 2009, 06:02 UTC
Message-ID
<bd6139dc0902122202r25e2e320m19810097cbb54225@mail.gmail.com>
In-Reply-To
<7vhc2zglz4.fsf@gitster.siamese.dyndns.org>
On Fri, Feb 13, 2009 at 02:32, Junio C Hamano <gitster@pobox.com> wrote:
> I wonder if we can (and if so should) make this a bit more automatic
> without having to say "rebase -f --whitespace=fix".

I have been thinking of that, having whitespace=fix imply -f, but I wasn't sure whether it makes sense for all workflows that might use rebase together with whitespace=fix. I aliased 'fixwhitespace' to 'rebase -f --whitespace=fix origin' myself, so I figured I'd send the patch as-is and see what people think :).

> The logic is the same as "git rebase --interactive origin" that does not
> refuse to work even if you are already ahead of the origin.

This makes sense, and after thinking about it some, I don't really see any harm in running 'git rebase --whitespace=...' even if the branch is up to date.

> So my suggestion would be to add --force (or -f) like your patch does, and
> also detect --whitespace=$option given from the command line, and if it is
> fix (or its synonym "strip"), automatically enable --force, perhaps as a
> follow up patch, or in the same patch.

The patch to do so would be fairly trivial I think? That is, add 'force_rebase=t' in the --whitespace=... part. Is that change small enough to be a single patch, or should it be a follow-up since the first patch is a-means-to-an-end for the second one?

-- 
Cheers,

Sverre Rabbelier
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 14 in “Teach rebase to rebase even if upstream is up to date with -f”
  1. Teach rebase to rebase even if upstream is up to date with -fSverre Rabbelier, Feb 12, 2009
  2. Johannes SchindelinFeb 12, 2009
  3. Sverre RabbelierFeb 12, 2009
  4. Johannes SchindelinFeb 12, 2009
  5. Sverre RabbelierFeb 12, 2009
  6. Junio C HamanoFeb 12, 2009
  7. Sverre RabbelierFeb 12, 2009
  8. Junio C HamanoFeb 12, 2009
  9. Sverre RabbelierFeb 12, 2009
  10. Junio C HamanoFeb 13, 2009
  11. Sverre RabbelierFeb 13, 2009
  12. Junio C HamanoFeb 13, 2009
  13. Sverre RabbelierFeb 13, 2009
  14. Junio C HamanoFeb 13, 2009

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.