[darcs-devel] [issue291] darcs record interactive option: "e" is for "edit"

Eric Kow bugs at darcs.net
Sun Aug 30 15:43:57 UTC 2009

Eric Kow <kowey at darcs.net> added the comment:

I've been chatting with Ganesh about this.  Here are my notes on the problem:

Ps   X   Y   Zs

- 1. break up a hunk patch into smaller patches

- 2. modify such a patch

- 3. maybe: modify the file including stuff not in the patch

- user interface: edit patch or edit file? supply both?
  - edit patch may be easier for wish 1
  - edit file seems simpler in general

- how to deal with subsequent patches
  - suppose I modify X into some X2
  - ideally Y Zs would be adjusted into Y2 Zs2
  - what if Y depends on X?
  - what if Y conflicts with X2 (roughly speaking)
  - scenarios:
     * X <-> Y
       * still X2 <-> Y (eg X2 is subset of X, OK!)
       * now Y conflicts wxth X2
     * not X <-> Y (Y depends on X)
       * now X2 <-> Y (eg X2 is subset of X, OK!)
       * what if X2 introduces a conflict?
  - wishlist
     * if Y is unhappy, skip it and move on to Zs
     * note that there may be unhappy Ys interleaved with Zs (maybe?)

- what do we do with the working directory?
  - if we confirm the record, do we just unapply the original X Y Zs and apply
the new X2 Y2 Zs?
  - what if we hit a conflict?
  - in case of #1 no need to touch working
  - in case of #2 then darcs revert to get rid of

- if Y conflicts with X2: could we refuse the modification?
- if Y depends on X

There are two ways to think about this.  Initially, I was thinking in terms of
merge (hence my concerns about the difficulty porting Y Zs to the new X2 (aka N).

Ganesh was thinking about it in a (imho) much nicer way, which is that the edit
operation always results into two patches: the new patch N and then the
leftovers [coalesce(N^ X)].  NB: to update the working directory, you just
revert the leftovers.

Ps         X  Y   Zs
Ps   N [N^ X] Y   Zs

nosy: +ckeen, ganesh, haikuvei, mornfall, pupeno, zandr, zooko
superseder:  -wish: ablity to split and otherwise record a hunk in record
topic: +Git

Darcs bug tracker <bugs at darcs.net>

More information about the darcs-devel mailing list