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

Re: [PATCH] branch: let '--edit-description' default to rebased branch during rebase

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 7, 2020, 20:14 UTC
Message-ID
<xmqqpneq2lzu.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CAPig+cTWxj+dRiYZEEbfUA7=NiEF3crTaYCVGPR2qG-VEV+Y0w@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 10 quoted lines
>> > > How about teaching "git branch --edit-description [HEAD]" notice
>> > > when/if HEAD is detached and always error out, no matter what
>> > > operation is in progress?
>>
>> What I meant by "no matter what is in progress" is not to special
>> case "during rebase", either.
>
> That would defeat the original purpose[1] of this submission, I think.
> As I understand it, the idea all along was to make this operation work
> during a rebase.
I know.  But I do not think it is a good thing to begin with.

While you are rebasing the branch X and get control back before rebase finishes, you are *not* on branch X. You are *preparing* a new version of the history leading to the tip of branch X, in the hope that once you are done, you would make that new version of the history the history of branch X. Until that happens, you are not on branch X.

If you were on branch X, then "git checkout -m another-branch" followed by some other operations, and then finally coming back with "git checkout -m X" would work. But it would not, because you are not on branch X.

After all, you may well say "git rebase --abort" before you are done. Would "edit description" you do in the middle be reverted if you did so?

It is bad for the user to blur the distinction between "detached and not on X but preparing to update X" and "working on X to advance X", and I think the original patch that started the thread takes us in that direction.

Thanks.
Previous: Eric Sunshine
Message 20 of 20 in “branch: let '--edit-description' default to rebased branch during rebase”
  1. branch: let '--edit-description' default to rebased branch during rebasemarcandre.lureau@redhat.com, Jan 11, 2020
  2. Eric SunshineJan 11, 2020
  3. Marc-André LureauJan 11, 2020
  4. Eric SunshineJan 12, 2020
  5. Marc-André LureauJan 12, 2020
  6. SZEDER GáborJan 12, 2020
  7. Eric SunshineJan 13, 2020
  8. SZEDER GáborJan 24, 2020
  9. Marc-André LureauJan 30, 2020
  10. SZEDER GáborJan 31, 2020
  11. Marc-André LureauJan 31, 2020
  12. SZEDER GáborJan 31, 2020
  13. Marc-André LureauFeb 6, 2020
  14. SZEDER GáborFeb 7, 2020
  15. Marc-André LureauFeb 7, 2020
  16. Junio C HamanoFeb 7, 2020
  17. Marc-André LureauFeb 7, 2020
  18. Junio C HamanoFeb 7, 2020
  19. Eric SunshineFeb 7, 2020
  20. Junio C HamanoFeb 7, 2020

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.