[darcs-users] Darcs equivalent of force-pushing and branching

Ben Franksen ben.franksen at online.de
Fri Sep 10 07:16:01 UTC 2021


Hi Alexis

James answered you second question: I am indeed planning to implement 
branches a la git in darcs and have layed some groundwork, but since we 
are so few developers and can only work on darcs in our free time, 
progress is not as fast as I would like.

Am 07.09.21 um 12:08 schrieb Alexis Praga:
> After looking at the darcsbooks, I found the unrecord and obliterate
> commands to remove patches from the history.
> Is there a way to remove them from the remote repository, like `git push -f` ?
> I've tried to "push" after "obliterate" but darcs replied with:
> 
>       No recorded local patches to push!

There is currently no way to obliterate patches in a remote repo, except 
in the manual way, i.e. first `darcs pull --dry-run`, remember the patch 
hashes, then go to the remote repo (possibly using ssh) and obliterate 
the patches there. I have occasionally had situations where I wanted to 
do this, e.g. to update an out-dated working clone of a project on 
hub.darcs.net with my latest version, discarding all the old patches there.

Since `darcs push` is internally implemented as a `darcs send` with the 
output piped into a remote `darcs apply`, implementing this feature as 
an option (say --obliterate, or perhaps --force or --clone) for `darcs 
push` would best be implemented by first adding the option to `darcs 
apply`. `darcs push --obliterate` would then simply pass the option 
along to the remote darcs invokation. The `darcs apply --obliterate` 
wouldn't be hard to implement: instead of merging the bundle with the 
local patches, we replace the local patches with the ones from the 
bundle. I think this is easy enough to be a suitable task for a 
newcomer. I will open a feature request on the tracker so we won't forget.

Cheers
Ben
-- 
I would rather have questions that cannot be answered, than answers that
cannot be questioned.  -- Richard Feynman




More information about the darcs-users mailing list