"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Christian Weisgerber <naddy@mips.inka.de>
Subject:
Re: got diff: add support for multiple path arguments
To:
gameoftrees@openbsd.org
Date:
Fri, 8 Oct 2021 22:45:59 +0200

Download raw body.

Thread
Stefan Sperling:

> > 	git diff 6.9 7.0 -- sys/net
> 
> Limiting the scope of a diff between two commits makes a lot of sense.

I too find myself resorting to git for this.

> How about:
>   got diff -c 6.9 -c 7.0 sys/net sys/dev/pci sys/dev/ic ...
> 
> Where -c expects an object ID or a reference which resolves to a
> commit object, much like many other commands.
> Use of -c would imply -P, i.e. all non-option arguments are paths.

How about going one step further and mandating "-c ... -c ..." for
diffing two objects, and dropping this magic use of "object1 object2"
we have now?

> A single -c option would also be supported:
>   got diff -c 6.9 sys/net
> 
> This could be the same as:
>   got diff -c first-parent-commit-of-6.9 -c 6.9 sys/net

Too much magic?

> Or, we could use a single -c option to represent the strange use case above,
> and show a diff between sys/net in commit 6.9 and sys/net in the worktree.

I'm not sure how useful it is, but that's the semantics you would
expect, no?

-- 
Christian "naddy" Weisgerber                          naddy@mips.inka.de