Skip to contentSkip to conversation

add --notes at git-show command to include notes in patches

PATCH In review Frank Li 2 participants 2 messages Jan 31, 2024 – Feb 1, 2024

lore
Share & tools
lore

Frank Li

author
#0 lore raw

PATCH 1/1 add --notes at git-show command to include notes in patches

I using notes to record patche's change log. b4 send will discard this. Add --notes options when create patches.

---
 b4/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
b4/__init__.py +1 -1
index 06a0518..a765820 100644
@@ -3277,7 +3277,7 @@ def git_range_to_patches(gitdir: Optional[str], start: str, end: str,
             logger.debug('Ignoring commit %s', commit)
             continue
         ecode, out = git_run_command(gitdir, ['show', '--format=email', '--patch-with-stat', '--encoding=utf-8',
-                                              commit], decode=False)
+                                              '--notes', commit], decode=False)
         if ecode > 0:
             raise RuntimeError(f'Could not get a patch out of {commit}')
         msg = email.message_from_bytes(out, policy=emlpolicy)
Signature · 1 line
2.34.1
#1 lore raw
Quoted 2 lines · Frank Li

I using notes to record patche's change log. b4 send will discard this. Add --notes options when create patches.

The biggest problem with using notes is that they are not currently preserved by git-filter-repo:

https://github.com/newren/git-filter-repo/issues/22

Yes, there are some (hacky) workarounds to make this work, but even with them, I am not comfortable with putting any information into notes that can just suddenly be gone.

For now, I will keep this in the list of improvements, but I won't take this patch until git-filter-repo does the right thing natively.

-K