git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3 2/3] patch-id: document new behaviour

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 2, 2014, 18:18 UTC
Message-ID
<xmqqy4zntx1p.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20140331204205.GB12403@redhat.com>
"Michael S. Tsirkin" <mst@redhat.com> writes:
Show 24 quoted lines
> On Mon, Mar 31, 2014 at 12:54:46PM -0700, Junio C Hamano wrote:
>> "Michael S. Tsirkin" <mst@redhat.com> writes:
>> 
>> > The hash used is mostly an internal implementation detail, isn't it?
>> 
>> Yes, but that does not mean we can break people who keep an external
>> database indexed with the patch-id by changing the default under
>> them, and "they can give --unstable option to work it around" is a
>> workaround, not a fix.  Without this change, they did not have to do
>> anything.
>> 
>> I would imagine that most of these people will be using the plain
>> vanilla "git show" output without any ordering or hunk splitting
>> when coming up with such a key.  A possible way forward to allow the
>> configuration that corresponds to "-O<orderfile>" while not breaking
>> the existing users could be to make the "patch-id --stable" kick in
>> automatically (of course, do this only when the user did not give
>> the "--unstable" command line option to override) when we see the
>> orderfile configuration in the repository, or when we see that the
>> incoming patch looks like reordered (e.g. has multiple "diff --git"
>> header lines that refer to the same path,
>
> This would require us to track affected files in memory.
> Issue?

Don't we already do that in order to handle a patch that touches the same path more than once anyway? I think a possibly larger issue might be that you would still want to do the hashing in a single pass so you may need to always keep two accumulated hashes, before you can decide if the patch is or is not a straight-forward one and use one of the two, but that hopefully should not require a rocket scientist.

Previous: Michael S. TsirkinNext: Michael S. Tsirkin
Message 7 of 15 in “patch-id: make it stable against hunk reordering”
  1. 1/3 patch-id: make it stable against hunk reorderingMichael S. Tsirkin, Mar 30, 2014
  2. 2/3 patch-id: document new behaviourMichael S. Tsirkin, Mar 30, 2014
  3. Junio C HamanoMar 31, 2014
  4. Michael S. TsirkinMar 31, 2014
  5. Junio C HamanoMar 31, 2014
  6. Michael S. TsirkinMar 31, 2014
  7. Junio C HamanoApr 2, 2014
  8. Michael S. TsirkinApr 2, 2014
  9. Junio C HamanoApr 3, 2014
  10. 3/3 patch-id-test: test --stable and --unstable flagsMichael S. Tsirkin, Mar 30, 2014
  11. Junio C HamanoMar 31, 2014
  12. Junio C HamanoMar 31, 2014
  13. Michael S. TsirkinMar 31, 2014
  14. Junio C HamanoMar 31, 2014
  15. Junio C HamanoMar 31, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.