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

Re: rebase -i --update-refs can lead to deletion of branches

From
Victoria Dye <vdye@github.com>
Date
Nov 4, 2022, 15:28 UTC
Message-ID
<bf5bc739-cb88-61ff-ed6b-09b1316f2f35@github.com>
In-Reply-To
<c195b67c-4dbc-a8b8-8513-2664e1ca2404@dunelm.org.uk>
Phillip Wood wrote:
Show 13 quoted lines
> We should be removing the entry entirely if the user removes it from the
> todo-list see b3b1a21d1a (sequencer: rewrite update-refs as user edits
> todo list, 2022-07-19) where the commit message says
> 
> 1. If a '<ref>/<before>/<after>' triple in the update-refs file does not
>    have a matching 'update-ref <ref>' command in the todo-list _and_ the
>    <after> value is the null OID, then remove that triple. Here, the
>    user removed the 'update-ref <ref>' command before it was executed,
>    since if it was executed then the <after> value would store the
>    commit at that position.
> 
> I think that is the best approach but it seems the implementation isn't
> actually doing that.

Thanks for pointing this out. This approach seems to have only been applied to 'git rebase --edit-todo', so ideally the fix will just be "do the same thing in the initial rebase."

I got sidetracked yesterday and didn't get as much time to work on this as I'd liked, but I should be able to send a patch today.

Previous: Phillip WoodNext: Victoria Dye
Message 8 of 17 in “rebase -i --update-refs can lead to deletion of branches”
  1. herr.kasteOct 20, 2022
  2. Erik Cervin EdinOct 20, 2022
  3. Phillip WoodNov 3, 2022
  4. herr.kasteNov 3, 2022
  5. Erik Cervin EdinNov 3, 2022
  6. Victoria DyeNov 4, 2022
  7. Phillip WoodNov 4, 2022
  8. Victoria DyeNov 4, 2022
  9. rebase --update-refs: avoid unintended ref deletionVictoria Dye, Nov 4, 2022
  10. Taylor BlauNov 4, 2022
  11. Phillip WoodNov 4, 2022
  12. Phillip WoodNov 4, 2022
  13. Derrick StoleeNov 7, 2022
  14. rebase --update-refs: avoid unintended ref deletionVictoria Dye, Nov 7, 2022
  15. Taylor BlauNov 7, 2022
  16. Derrick StoleeNov 7, 2022
  17. Phillip WoodNov 8, 2022

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.