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

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: got patch: add -c to apply at specified commit
To:
Omar Polo <op@omarpolo.com>
Cc:
gameoftrees@openbsd.org
Date:
Thu, 28 Jul 2022 12:23:55 +0200

Download raw body.

Thread
On Wed, Jul 27, 2022 at 04:46:39PM +0200, Omar Polo wrote:
> diff refs/heads/main refs/heads/pc
> commit - 615e455c6bdddbd4e59d5d0dece41eb9953b6336
> commit + 6334862bab97cd016628d6b9b5230904f1ebc231

ok stsp@

Questions for potential follow-up improvements:

When patch -pN is used in combination with patch -c then the
stripped version of paths will be looked up in the repository,
Should we mention this behaviour in the documentation? It could
lead to surprising results in case some unrelated file exists in
the specified commit at this stripped path.

If the path cannot be found in the commit, got patch will not do a
3-way merge. Should it try to look up a blob ID directly in that case,
if a blob ID was available in diff headers? This might be useful in case
a diff was generated against a commit which does not (yet) exist in the
local repository, and where the referenced base blob does already exist
somewhere in history. Again a narrow edge case, but I don't see why we
should not use the base blob if we have it available.