[darcs-users] Getting a full diff for pulled patches

David Roundy droundy at darcs.net
Tue Jul 31 23:09:45 UTC 2007


On Wed, Aug 01, 2007 at 12:43:44AM +0200, Alexander Staubo wrote:
> To start, I realized neither "pull" nor "changes" can provide patch
> hashes (well, changes can, but only in XML mode, which does not have
> diffs). At the moment I do one "pull --dry-run" to get all the pending
> patches so I can list them. When the user wants to inspect a patch, I
> run "changes --verbose --to-match=..." to build the file and derive
> the most recent diff that comes out of the pull.

We could certainly add more information (possibly optional) to the xml
output.

> The only workaround I can think of is to run Darcs interactively, but
> that complicates things awfully, and I would like to avoid it. My
> intent is to warn the user: "You're pulling patch A. This requires
> patch B. Do you want to continue?" As I think you pointed out, even if
> I used the interactive prompt in conjunction with the "w" command, I
> would not know when I had reached the last patch.

You could actually compute the dependencies of the last patch by selecting
'n' for earlier patches and seeing which ones disable the last one.

> Given all of the above, I think two small improvements would be
> enormously helpful:
> 
> (1) Let "pull", "push", "changes" and possibly others print patch
> hashes (in --verbose, perhaps).

Sure.  The reason it's only in the XML output is because that's the only
one that is designed for machine consumption.  Another approach would be to
improve XML output so that you could use it effectively.

Adding (optional) patch hashes to the --dry-run output would be fine,
although I'd rather not have programs having to parse darcs' human-readable
output.  That's just a fragile approach.  :(

> (2) Add a flag to "pull" and possibly "changes" that included the
> patch context in the output. I believe this would be sufficient to
> determine dependencies.

I'm not sure what you mean by the "patch context."  In standard darcs
terminology, this would mean the set of all preceding patches, which is
pretty obvious in darcs changes, and also completely useless with regard to
determining dependencies.

> Lastly: Does Darcs have a way to disable the loading of one's personal
> defaults file, akin to CVS' -f ("Do not use the ~/.cvsrc file.") flag?

No, that's a reasonable idea, although then we might also need a way to
disable the disabling of the defaults file, since one possible use of
defaults is to lock down a repository (e.g. using --disable to disallow
certain dangerous commands, and making defaults not be modifiable by
users).  It's not a particularly pretty or powerful approach to security,
but we also don't want to silently dismantle our users' security
mechanisms.
-- 
David Roundy
Department of Physics
Oregon State University



More information about the darcs-users mailing list