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

Re: Should --update-refs exclude refs pointing to the current HEAD?

From
SHStefan Haller <lists@haller-berlin.de>
Date
Apr 17, 2023, 09:22 UTC
Message-ID
<6a8b92d8-5b86-9cf3-3619-4c8bedfa2d47@haller-berlin.de>
In-Reply-To
<d3895d9b-b45a-449d-a5e6-b8b8c5e6c4b8@app.fastmail.com>
On 17.04.23 10:34, Kristoffer Haugsbakk wrote:
Show 14 quoted lines
> Hi
> 
> On Mon, Apr 17, 2023, at 10:21, Stefan Haller wrote:
>> 2. I have a topic branch, and I want to make a copy of it to make some
>> heavy history rewriting experiments. Again, my interactive rebases would
>> always rebase both branches in the same way, not what I want. In this
>> case I could work around it by doing the experiments on the original
>> branch, creating a tag beforehand that I could reset back to if the
>> experiments fail. But maybe I do want to keep both branches around for a
>> while for some reason.
> 
> I would use a lightweight tag, too, since this option doesn’t touch tags.[1]
> 
> Why do you want to keep both branches around? 
Several reasons:

Maybe the original branch was pushed already, and I'm collaborating on it with a coworker. At the same time, I want to run my rebase experiment in parallel on a copy.

Maybe I want to create github PRs for both of them, in order to run CI on them, or get feedback for both of them from my coworkers.

Also, it just seems to be the most natural workflow for many people. I have seen my coworkers do this a lot without thinking much whether there would be a better way.

My question is not so much whether copying branches is a good idea, it's more about how --update-refs should deal with copied branches *if* you decide to use them.

-Stefan
Previous: Kristoffer HaugsbakkNext: Felipe Contreras
Message 4 of 18 in “Should --update-refs exclude refs pointing to the current HEAD?”
  1. Stefan HallerApr 17, 2023
  2. Stefan HallerApr 17, 2023
  3. Kristoffer HaugsbakkApr 17, 2023
  4. Stefan HallerApr 17, 2023
  5. Felipe ContrerasApr 18, 2023
  6. Phillip WoodApr 17, 2023
  7. Stefan HallerApr 20, 2023
  8. Stefan HallerMar 5, 2024
  9. Junio C HamanoMar 5, 2024
  10. Elijah NewrenMar 6, 2024
  11. Stefan HallerMar 6, 2024
  12. Elijah NewrenMar 7, 2024
  13. Stefan HallerMar 7, 2024
  14. Elijah NewrenMar 9, 2024
  15. Stefan HallerMar 12, 2024
  16. Kristoffer HaugsbakkMar 7, 2024
  17. Elijah NewrenMar 7, 2024
  18. Stefan HallerMar 24, 2024

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.