Linux maintainer tooling and workflows
 help / color / mirror / Atom feed
* [b4] add notes to patch for commit with git-notes?
@ 2024-09-02 16:51 Quentin Schulz
  2024-09-02 17:10 ` Matthieu Baerts
  0 siblings, 1 reply; 3+ messages in thread
From: Quentin Schulz @ 2024-09-02 16:51 UTC (permalink / raw)
  To: Kernel.org Tools; +Cc: Farouk Bouabid

Hi all,

https://www.kernel.org/doc/html/latest/process/submitting-patches.html#separate-your-changes 
says that

 > If one patch depends on another patch in order for a change to be 
complete, that is OK. Simply note “this patch depends on patch X” in 
your patch description.

We forgot to add this note (we weren't aware of the rule at the time) 
and made some people unhappy due to some partial merges (one part going 
through one tree, its dependency in the same patch series still in review).

I asked some maintainer whether we should have this note in the cover 
letter or in the patch and the answer was "ideally both". I know how to 
do the former with b4, but not the latter. I would like to avoid having 
to use multiple tools to do the same job.

I think it should be possible to use git-notes for the latter?

We did a quick test and it seems it works (with a diff I'm pasting later 
in this mail), c.f. 
https://lore.kernel.org/linux-rockchip/20240902-dev-mule-i2c-mux-v7-3-bf7b8f5385ed@cherry.de/

For that we had to set notes.rewrite.rebase config to true so that b4 
prep --edit-cover wouldn't "erase" the notes (and same with 
notes.rewrite.amend just in case one does git commit --amend or reword 
with git rebase).

The diff we had for b4 to make this work is the following:

"""
diff --git a/src/b4/__init__.py b/src/b4/__init__.py
index ec230e7..72621b8 100644
--- a/src/b4/__init__.py
+++ b/src/b4/__init__.py
@@ -3424,7 +3424,7 @@ def git_range_to_patches(gitdir: Optional[str], 
start: str, end: str,
          if commit in ignore_commits:
              logger.debug('Ignoring commit %s', commit)
              continue
-        ecode, out = git_run_command(gitdir, ['show', '--format=email', 
'--patch-with-stat', '--encoding=utf-8',
+        ecode, out = git_run_command(gitdir, ['show', '--format=email', 
'--patch-with-stat', '--encoding=utf-8', '--notes',
                                                commit], decode=False)
          if ecode > 0:
              raise RuntimeError(f'Could not get a patch out of {commit}')

"""

Now I'm wondering if we should have this always on or not, also if/how 
we should document that one needs to have notes.rewrite.rebase/amend set 
for this to work. Should we also add a knob to NOT add the notes (e.g. 
someone wants to keep notes for their use but only locally and not send 
those).

Let me know if git-notes would be fine and the direction to go for 
patches. Thanks!

Cheers,
Quentin

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

end of thread, other threads:[~2024-09-02 17:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-02 16:51 [b4] add notes to patch for commit with git-notes? Quentin Schulz
2024-09-02 17:10 ` Matthieu Baerts
2024-09-02 17:19   ` Quentin Schulz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox