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

Re: A couple of rebase --autosquash proposals

From
Brett Randall <javabrett@gmail.com>
Date
Dec 9, 2013, 23:20 UTC
Message-ID
<CALeEUB7ztc0Cfz0J2MJp0HiiDNY1y98AarGeSGKKCtdp_bjekQ@mail.gmail.com>
In-Reply-To
<xmqq1u1lzshd.fsf@gitster.dls.corp.google.com>

I had not previously noticed commit --fixup, so that is something useful I have learned from this thread, thanks.

The workflow here can be summarized as "I have an initial commit and subsequent, review-generated commits, that I'd like to share on a review-branch with proper commit-log comments, but also pre-marked for future --autosquash". So when the review is completed, I can auto squash/fixup all the review-generated commits and rebase onto origin/master at the same time. I find this more appealing than continually pushing rebased branches to colleagues, as the history is lost and it is hard to review incremental changes.

I can live with it as it is: I just use rebase -i and change all review-generated commits pick -> r as if autosquash didn't exist. It's just that when I first tried-out fixup!, I mistakenly thought that I could use the first line as the special syntax, and use following-lines as annotation - which is not the case, but I thought it might be worth suggesting here.

Brett
On 10 December 2013 07:20, Junio C Hamano <gitster@pobox.com> wrote:
Show 24 quoted lines
> Johannes Sixt <j.sixt@viscovery.net> writes:
>
>> Am 12/9/2013 3:23, schrieb Brett Randall:
>>> * fixup! or squash! on it's own would default to fixing-up the
>>> previous commit (or result of previous step of rebase if that was a
>>> squash/fixup).
>>
>> Why would you want that? To fixup the previous commit, just use 'git
>> commit --amend'. What am I missing?
>
> When you are not absolutely sure if the amend is a good thing to do.
>
> Then
>
>         work work work
>         git commit --fixup HEAD
>         work work work
>         git commit --fixup HEAD^
>         work work work
>         git commit --fixup HEAD^^
>         ...
>         git rebase --autosquash -i ...
>
> may become a good way to polish a single commit.
Previous: Junio C Hamano
Message 7 of 7 in “A couple of rebase --autosquash proposals”
  1. Brett RandallDec 9, 2013
  2. Johannes SixtDec 9, 2013
  3. Chris PackhamDec 9, 2013
  4. Philippe VaucherDec 9, 2013
  5. Brett RandallDec 9, 2013
  6. Junio C HamanoDec 9, 2013
  7. Brett RandallDec 9, 2013

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.