Page MenuHomePhorge

Running "arc patch D123" 4 times fails
Open, LowPublic


If I understand the current underlying issue, arc patch D123 can only be executed 4 times, then, since it created too much branches, it fails.

Steps to reproduce:

  • git checkout master; arc patch D25049 (1 time)
  • git checkout master; arc patch D25049 (2 time)
  • git checkout master; arc patch D25049 (3 time)
  • git checkout master; arc patch D25049 (4 time)

Then you obtain:

Branch name arcpatch-D25049 already exists; trying a new name.
Branch name arcpatch-D25049_1 already exists; trying a new name.
Branch name arcpatch-D25049_2 already exists; trying a new name.
Branch name arcpatch-D25049_3 already exists; trying a new name.
Arc was unable to automagically make a name for this patch. Please clean up your working copy and try again.
(Run with `--trace` for a full exception trace.)

Event Timeline

Thank you to @ncollins who helped me in understanding this topic, since I was not aware of this issue before today.

To be honest I use to run arc patch multiple times in my life over the same Diff, for multiple reasons. Some of my reasons are probably frequent by others. For example, I just have very few time and I want the latest changes from a Diff, and I don't know how to update the already existing branch with a clean arc-way so I run arc patch D123. Also, I often honesty just don't check whenever I've just executed an arc patch over that Diff (and I don't want to, honestly).

In short: my root problem is that I would like to use arc patch D123 like it was idempotent, so whenever I run it once, or 1 billion times from the master, I just want to quickly download that patch and have it on my computer to test it etc. Bonus point: without clogging my git with 1 billion of branches with similar names and with the very same commits inside.

What makes me frustrated: there should be no need to propose this change:

D25027: Allow an infinite number of arcpatch_DXXXX_X branches to be created

In an ideal world where arc patch was smart enough to just do not clog your branches with very-very-identic branches, just because you run arc patch D123 4 times in your life. Note, I'm not talking about "avoiding overwriting your work in my branch" (that is reasonable) but as far as I can see, I'm talking about "avoiding creating really duplicate branches" - so in my opinion this is a bug in arc patch, where it should create another branch only if your already-existing branch diverged from remote, and not always.

In any case, with or without an improvement by arc patch, since it may also happen that your branches created by arc patch diverge 4 time; this specific future super-niche use case still deserves to be not stopped by an exception. So, I just 100% support the idea behind D25027 since it will still do something useful to the end-user, in my opinion.