Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commit message summary line starting with tag does not seem to recognize tag #928

Open
jwir3 opened this issue Jun 26, 2021 · 1 comment · May be fixed by #929
Open

Commit message summary line starting with tag does not seem to recognize tag #928

jwir3 opened this issue Jun 26, 2021 · 1 comment · May be fixed by #929

Comments

@jwir3
Copy link

jwir3 commented Jun 26, 2021

Using git-journal version: 1.8.1

I use gitmoji to tag the categories of my commits. As such, the tags for git-journal also correspond to categories. In order to alleviate this problem, I use the first word of the commit message as the category. For example, with a commit message having status line:

:bug: Fix an issue where base_url was not being correctly used.

The category would be "Fix" and the tag would be ":bug:" (or, rather just "bug").

This appears to work, however, in does not recognize tags that are at the start of the commit message status line. Consider the following log with config files (please note this is a real commit log available here:

Commit Log:

commit 8f416562eb3f50be26b97b4f9f485310020637b1 (HEAD -> main)
Author: Scott Johnson <jaywir3@gmail.com>
Date:   Sat Jun 26 10:59:30 2021 -0500

    Added blah blah blah :sparkles:

commit 5531fcaa54dc7cf2b3318fc1f213a08483d5ebd2 (origin/main)
Author: Scott Johnson <jaywir3@gmail.com>
Date:   Fri Jun 25 22:56:09 2021 -0500

    :bug: Fix issues with DELETE endpoint.

commit 2ad37a77efb6d7c4951784bac850087dcb5b7070 (tag: 1.0.3)
Author: Scott Johnson <jaywir3@gmail.com>
Date:   Fri Jun 25 22:45:54 2021 -0500

    :bug: Fix issue where userOrg was being input incorrectly.

commit 41102cd4a39b3521e1fc8db1e50f8b8a212fa45d (tag: 1.0.2)
Author: Scott Johnson <jaywir3@gmail.com>
Date:   Fri Jun 25 22:41:00 2021 -0500

    :bug: Fix an issue where base_url was not being correctly used.

commit 7d6931767f3fb601db4335a0869aae0ca13895ad (tag: 1.0.1)
Author: Scott Johnson <jaywir3@gmail.com>
Date:   Fri Jun 25 22:28:57 2021 -0500

    :lock: Remove accidentally committed PAT.

commit 444b3a64355557844beb848d80051ada2c00176a (tag: 1.0.0)
Author: Scott Johnson <jaywir3@gmail.com>
Date:   Fri Jun 25 22:06:49 2021 -0500

    :tada: Initial commit.

.gitjournal.toml

categories = ["Fix", "Remove", "Initial", "Added"]                              
category_delimiters = ["", ""]                                                  
colored_output = true                                                           
enable_debug = true                                                             
enable_footers = false                                                          
excluded_commit_tags = [""]                                                     
show_commit_hash = true                                                         
show_prefix = false                                                             
sort_by = "name"                                                                
template_prefix = "" 

template.toml

[[tags]]                                                                        
footers = []                                                                    
name = "default"                                                                
tag = "default"                                                                 
                                                                                
[[tags]]                                                                        
footers = []                                                                    
name = "Miscellaneous"                                                          
tag = "tada"                                                                    
                                                                                
[[tags]]                                                                        
footers = []                                                                    
name = "Features"                                                               
tag = "sparkles"                                                                
                                                                                
[footer]                                                                        
once = false                                                                    
text = ""                                                                       
                                                                                
[header]                                                                        
once = false                                                                    
text = ""  

When run with the command: git journal -a -t template.toml

Now, what I would expect is that there is one commit that get placed in the "Features" and "Miscellaneous" categories, respectively. Instead, there are no commits in Miscellaneous and there is a single commit in Features (the one having :sparkles: at the end of the line.

jwir3 added a commit to jwir3/git-journal that referenced this issue Jun 26, 2021
If tags appeared before the category when parsing, the tags would not be
added to the list of tags in the commit message. This was due, in part, to
a regular expression that did not consider the possibility that the tag
could be at the beginning of a line, and partially due to the fact that
tags were only parsed from the remainder of the line AFTER categories had
been removed.

Fixes saschagrunert#928.
@saschagrunert
Copy link
Owner

Thank you for the report! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants