diff mbox series

[b4] ty: auto-matching: Do not consume commit decorations

Message ID 20240207-ty-do-not-consume-commit-decorations-v1-1-995e5ff6666b@avm.de (mailing list archive)
State Accepted
Headers show
Series [b4] ty: auto-matching: Do not consume commit decorations | expand

Commit Message

Nicolas Schier Feb. 7, 2024, 8:25 a.m. UTC
From: Nicolas Schier <nicolas@fjasle.eu>

Disable decoration when reading git log output for getting a list of git
commits.

Without '--no-decorate', commits that have branches or tags pointing to
them, will not be recognised by subject as get_all_commits will assume
that the decoration is part of the commits subject line, e.g.:

    (HEAD -> main, tag: v1.142, origin/main) Dummy commit subject

instead of

    Dummy commit subject

thus the former will never match the real patch subject line.

Signed-off-by: Nicolas Schier <nicolas@fjasle.eu>
---


Signed-off-by: Nicolas Schier <n.schier@avm.de>
---
 b4/ty.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


---
base-commit: 2d94097cd5aedddd6985ec6154e0956293f4143b
change-id: 20240207-ty-do-not-consume-commit-decorations-302d8e54f95d

Best regards,

Comments

Nicolas Schier Feb. 7, 2024, 9:33 a.m. UTC | #1
On Wed, Feb 07, 2024 at 09:25:35AM +0100, Nicolas Schier wrote:
> From: Nicolas Schier <nicolas@fjasle.eu>
> 
> Disable decoration when reading git log output for getting a list of git
> commits.
> 
> Without '--no-decorate', commits that have branches or tags pointing to
> them, will not be recognised by subject as get_all_commits will assume
> that the decoration is part of the commits subject line, e.g.:
> 
>     (HEAD -> main, tag: v1.142, origin/main) Dummy commit subject

oh, I forgot to mention that this is only true for those having git
config log.decorate enabled.

Kind regards,
Nicolas
Konstantin Ryabitsev Feb. 7, 2024, 5:16 p.m. UTC | #2
On Wed, 07 Feb 2024 09:25:35 +0100, Nicolas Schier wrote:
> Disable decoration when reading git log output for getting a list of git
> commits.
> 
> Without '--no-decorate', commits that have branches or tags pointing to
> them, will not be recognised by subject as get_all_commits will assume
> that the decoration is part of the commits subject line, e.g.:
> 
> [...]

Applied, thanks!

[1/1] ty: auto-matching: Do not consume commit decorations
      commit: 0fe26a3bbadfeb4a86f92b7b1e32aef203fe59f7

Best regards,
diff mbox series

Patch

diff --git a/b4/ty.py b/b4/ty.py
index 088933d..a8bdabf 100644
--- a/b4/ty.py
+++ b/b4/ty.py
@@ -164,7 +164,7 @@  def get_all_commits(gitdir: Optional[str], branch: str, since: str = '1.week',
         usercfg = b4.get_user_config()
         committer = usercfg['email']
 
-    gitargs = ['log', '--committer', committer, '--no-abbrev', '--oneline', '--since', since, branch]
+    gitargs = ['log', '--committer', committer, '--no-abbrev', '--no-decorate', '--oneline', '--since', since, branch]
     lines = b4.git_get_command_lines(gitdir, gitargs)
     if not len(lines):
         logger.debug('No new commits from the current user --since=%s', since)