All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] b4: ty: Fix incorrect patch/commit association
@ 2024-03-04 13:42 Will Deacon
  2024-03-04 13:42 ` [PATCH v2 1/2] ty: Try subject matching for every commit before using trackers Will Deacon
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Will Deacon @ 2024-03-04 13:42 UTC (permalink / raw
  To: tools; +Cc: Will Deacon, Konstantin Ryabitsev, Jason Gunthorpe, Nicolin Chen

Hi folks,

It's me again. This time I fixed my git configuration so that the
authorship is correct and matches the S-o-B line. That's the only change
since the v1 I sent on Friday.

Enjoy!

Will

Cc: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Nicolin Chen <nicolinc@nvidia.com>

--->8

Will Deacon (2):
  ty: Try subject matching for every commit before using trackers
  ty: Remove unused 'matches' variable

 src/b4/ty.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

-- 
2.44.0.rc1.240.g4c46232300-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 1/2] ty: Try subject matching for every commit before using trackers
  2024-03-04 13:42 [PATCH v2 0/2] b4: ty: Fix incorrect patch/commit association Will Deacon
@ 2024-03-04 13:42 ` Will Deacon
  2024-03-04 13:42 ` [PATCH v2 2/2] ty: Remove unused 'matches' variable Will Deacon
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Will Deacon @ 2024-03-04 13:42 UTC (permalink / raw
  To: tools; +Cc: Will Deacon, Konstantin Ryabitsev, Jason Gunthorpe, Nicolin Chen

Nicolin reports that 'b4 ty' produced a "thank you" letter with
incorrect commit IDs:

  https://lore.kernel.org/r/ZeDtfKMUXnOnJOic@Asurada-Nvidia

This appears to be because of the creative use of Message-Ids in the
series at:

  https://lore.kernel.org/r/0-v6-96275f25c39d+2d4-smmuv3_newapi_p1_jgg@nvidia.com

For example, comparing the Message-Id of patches 1 and 11 of that series,
we can see that one is a substring of the other:

  Message-Id: <1-v6-96275f25c39d+2d4-smmuv3_newapi_p1_jgg@nvidia.com>
  Message-Id: <11-v6-96275f25c39d+2d4-smmuv3_newapi_p1_jgg@nvidia.com>

This confuses auto_locate_series(), as it will end up matching the
Message-Id of patch 1 with the Link: tag in patch 11 and therefore get
the wrong patch/commit association.

Fix this problem by trying to match each commit based on the Subject
before falling back to the fuzzier tracker-based matching.

Reported-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Will Deacon <will@kernel.org>
---
 src/b4/ty.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/b4/ty.py b/src/b4/ty.py
index a8bdabf5bcbc..950c357a89c5 100644
--- a/src/b4/ty.py
+++ b/src/b4/ty.py
@@ -217,7 +217,13 @@ def auto_locate_series(gitdir: Optional[str], jsondata: dict, branch: str,
                     success = True
                     matches += 1
                     break
-                elif len(patch) > 2 and len(patch[2]) and len(commit[2]):
+
+            if success:
+                continue
+
+            # try to locate by tracker
+            for pwhash, commit in commits.items():
+                if len(patch) > 2 and len(patch[2]) and len(commit[2]):
                     for tracker in commit[2]:
                         if tracker.find(patch[2]) >= 0:
                             logger.debug('Matched using recorded message-id')
-- 
2.44.0.rc1.240.g4c46232300-goog


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 2/2] ty: Remove unused 'matches' variable
  2024-03-04 13:42 [PATCH v2 0/2] b4: ty: Fix incorrect patch/commit association Will Deacon
  2024-03-04 13:42 ` [PATCH v2 1/2] ty: Try subject matching for every commit before using trackers Will Deacon
@ 2024-03-04 13:42 ` Will Deacon
  2024-03-04 21:32 ` [PATCH v2 0/2] b4: ty: Fix incorrect patch/commit association Konstantin Ryabitsev
  2024-05-01 21:23 ` Konstantin Ryabitsev
  3 siblings, 0 replies; 7+ messages in thread
From: Will Deacon @ 2024-03-04 13:42 UTC (permalink / raw
  To: tools; +Cc: Will Deacon, Konstantin Ryabitsev, Jason Gunthorpe, Nicolin Chen

The 'matches' variable in auto_locate_series() is updated but not used
for anything, so remove it.

Signed-off-by: Will Deacon <will@kernel.org>
---
 src/b4/ty.py | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/b4/ty.py b/src/b4/ty.py
index 950c357a89c5..97f4c44a0832 100644
--- a/src/b4/ty.py
+++ b/src/b4/ty.py
@@ -198,7 +198,6 @@ def auto_locate_series(gitdir: Optional[str], jsondata: dict, branch: str,
     patchids = set(commits.keys())
     # We need to find all of them in the commits
     found = list()
-    matches = 0
     at = 0
     for patch in jsondata['patches']:
         at += 1
@@ -206,7 +205,6 @@ def auto_locate_series(gitdir: Optional[str], jsondata: dict, branch: str,
         if patch[1] in patchids:
             logger.debug('Found: %s', patch[0])
             found.append((at, commits[patch[1]][0]))
-            matches += 1
         else:
             # try to locate by subject
             success = False
@@ -215,7 +213,6 @@ def auto_locate_series(gitdir: Optional[str], jsondata: dict, branch: str,
                     logger.debug('Matched using subject')
                     found.append((at, commit[0]))
                     success = True
-                    matches += 1
                     break
 
             if success:
@@ -229,7 +226,6 @@ def auto_locate_series(gitdir: Optional[str], jsondata: dict, branch: str,
                             logger.debug('Matched using recorded message-id')
                             found.append((at, commit[0]))
                             success = True
-                            matches += 1
                             break
                 if success:
                     break
-- 
2.44.0.rc1.240.g4c46232300-goog


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 0/2] b4: ty: Fix incorrect patch/commit association
  2024-03-04 13:42 [PATCH v2 0/2] b4: ty: Fix incorrect patch/commit association Will Deacon
  2024-03-04 13:42 ` [PATCH v2 1/2] ty: Try subject matching for every commit before using trackers Will Deacon
  2024-03-04 13:42 ` [PATCH v2 2/2] ty: Remove unused 'matches' variable Will Deacon
@ 2024-03-04 21:32 ` Konstantin Ryabitsev
  2024-05-01 21:23 ` Konstantin Ryabitsev
  3 siblings, 0 replies; 7+ messages in thread
From: Konstantin Ryabitsev @ 2024-03-04 21:32 UTC (permalink / raw
  To: tools, Will Deacon; +Cc: Jason Gunthorpe, Nicolin Chen


On Mon, 04 Mar 2024 13:42:39 +0000, Will Deacon wrote:
> It's me again. This time I fixed my git configuration so that the
> authorship is correct and matches the S-o-B line. That's the only change
> since the v1 I sent on Friday.
> 
> Enjoy!
> 
> Will
> 
> [...]

Applied, thanks!

[1/2] ty: Try subject matching for every commit before using trackers
      commit: 8a3d8bfae18ad1f4c72b91e6a8d37e12f9b5dcb4
[2/2] ty: Remove unused 'matches' variable
      commit: bb6d9075ae89df46ad91e85466a7b01f6aa534d8

Best regards,
-- 
Konstantin Ryabitsev <konstantin@linuxfoundation.org>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 0/2] b4: ty: Fix incorrect patch/commit association
  2024-03-04 13:42 [PATCH v2 0/2] b4: ty: Fix incorrect patch/commit association Will Deacon
                   ` (2 preceding siblings ...)
  2024-03-04 21:32 ` [PATCH v2 0/2] b4: ty: Fix incorrect patch/commit association Konstantin Ryabitsev
@ 2024-05-01 21:23 ` Konstantin Ryabitsev
  2024-05-02  9:23   ` Will Deacon
  3 siblings, 1 reply; 7+ messages in thread
From: Konstantin Ryabitsev @ 2024-05-01 21:23 UTC (permalink / raw
  To: tools, Will Deacon; +Cc: Jason Gunthorpe, Nicolin Chen


On Mon, 04 Mar 2024 13:42:39 +0000, Will Deacon wrote:
> It's me again. This time I fixed my git configuration so that the
> authorship is correct and matches the S-o-B line. That's the only change
> since the v1 I sent on Friday.
> 
> Enjoy!
> 
> Will
> 
> [...]

Applied, thanks!

[1/2] ty: Try subject matching for every commit before using trackers
      commit: 47bd55d3182d875802700670270f5ee0877a8d5d
[2/2] ty: Remove unused 'matches' variable
      commit: dced92071d2135ccbec521cb4face63cafcdc407

Best regards,
-- 
Konstantin Ryabitsev <konstantin@linuxfoundation.org>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 0/2] b4: ty: Fix incorrect patch/commit association
  2024-05-01 21:23 ` Konstantin Ryabitsev
@ 2024-05-02  9:23   ` Will Deacon
  2024-05-02 18:31     ` Konstantin Ryabitsev
  0 siblings, 1 reply; 7+ messages in thread
From: Will Deacon @ 2024-05-02  9:23 UTC (permalink / raw
  To: Konstantin Ryabitsev; +Cc: tools, Jason Gunthorpe, Nicolin Chen

On Wed, May 01, 2024 at 05:23:12PM -0400, Konstantin Ryabitsev wrote:
> 
> On Mon, 04 Mar 2024 13:42:39 +0000, Will Deacon wrote:
> > It's me again. This time I fixed my git configuration so that the
> > authorship is correct and matches the S-o-B line. That's the only change
> > since the v1 I sent on Friday.
> > 
> > Enjoy!
> > 
> > Will
> > 
> > [...]
> 
> Applied, thanks!
> 
> [1/2] ty: Try subject matching for every commit before using trackers
>       commit: 47bd55d3182d875802700670270f5ee0877a8d5d
> [2/2] ty: Remove unused 'matches' variable
>       commit: dced92071d2135ccbec521cb4face63cafcdc407

You applied these already (with different SHAs), I think:

https://lore.kernel.org/r/170958794467.8875.12454526353405240108.b4-ty@linuxfoundation.org

So I'm not sure what's happened here :/

Will

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 0/2] b4: ty: Fix incorrect patch/commit association
  2024-05-02  9:23   ` Will Deacon
@ 2024-05-02 18:31     ` Konstantin Ryabitsev
  0 siblings, 0 replies; 7+ messages in thread
From: Konstantin Ryabitsev @ 2024-05-02 18:31 UTC (permalink / raw
  To: Will Deacon; +Cc: tools, Jason Gunthorpe, Nicolin Chen

On Thu, May 02, 2024 at 10:23:54AM GMT, Will Deacon wrote:
> > Applied, thanks!
> > 
> > [1/2] ty: Try subject matching for every commit before using trackers
> >       commit: 47bd55d3182d875802700670270f5ee0877a8d5d
> > [2/2] ty: Remove unused 'matches' variable
> >       commit: dced92071d2135ccbec521cb4face63cafcdc407
> 
> You applied these already (with different SHAs), I think:
> 
> https://lore.kernel.org/r/170958794467.8875.12454526353405240108.b4-ty@linuxfoundation.org
> 
> So I'm not sure what's happened here :/

Bah, you're right. I blame the split brain between b4 and patchwork here 
-- for some reason in patchwork these were still showing as unprocessed.

Effectively the 2nd time was a no-op:

  $ git log --oneline --reverse 590044aff85f3e11cbd5efb9e192847bb3b51b3f..
  47bd55d ty: Try subject matching for every commit before using trackers
  dced920 ty: Remove unused 'matches' variable
  775893e (HEAD -> master, origin/master, github/master) Merge patch series "b4: ty: Fix incorrect patch/commit association"
  $ git diff 590044aff85f3e11cbd5efb9e192847bb3b51b3f..
  (no output)

I am actually annoyed that this operation doesn't throw an error and 
doubly annoyed that the only way to fix this is to rebase -- but rebase 
I will.

Sorry about the mess.

-K

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-05-02 18:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-04 13:42 [PATCH v2 0/2] b4: ty: Fix incorrect patch/commit association Will Deacon
2024-03-04 13:42 ` [PATCH v2 1/2] ty: Try subject matching for every commit before using trackers Will Deacon
2024-03-04 13:42 ` [PATCH v2 2/2] ty: Remove unused 'matches' variable Will Deacon
2024-03-04 21:32 ` [PATCH v2 0/2] b4: ty: Fix incorrect patch/commit association Konstantin Ryabitsev
2024-05-01 21:23 ` Konstantin Ryabitsev
2024-05-02  9:23   ` Will Deacon
2024-05-02 18:31     ` Konstantin Ryabitsev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.