dirk-thomas / vcstool

Vcstool is a command line tool designed to make working with multiple repositories easier
Apache License 2.0
410 stars 87 forks source link

"vcs log" output can be a bit too verbose for --limit_untagged #196

Open 130s opened 3 years ago

130s commented 3 years ago

Problem

By printing VCS' commit message format per every commit, the output of vcs log --limit_untagged can be large, which often makes it hard to grasp. I imagine the problem is pretty much the same with git developers adding --oneline option to log verb.

Attempted (but wasn't successful) approach

Using vcs custom I tried the following (the argument passed is taken from what vcs log --limit_untagged internally does).

vcs custom --git --args log --oneline `git describe --abbrev=0 --tags`..

root@92e14a2e6eca:/catkin_ws/src# vcs custom --git --args log --oneline `git describe --abbrev=0 --tags`..
fatal: Not a git repository (or any of the parent directories): .git
EEEEEEEEEEEEEEEEEE
=== ./intel-ros/realsense (git) ===
fatal: ..: '..' is outside repository
=== ./pokemon (git) ===
fatal: ..: '..' is outside repository
=== ./nintendo/boncurry/boncurry (git) ===
fatal: ..: '..' is outside repository
:
=== ./zivid-ros (git) ===
fatal: ..: '..' is outside repository

The following works. So I assume plugging in the value by back-tick doesn't work.

# vcs custom --git --args describe --abbrev=0 --tags
.....E............                   
=== ./intel-ros/realsense (git) ===                                                                      
100.2217.1                           
=== ./pokemon (git) ===                        
3.7.0                                
=== ./nintendo/boncurry/boncurry (git) ===      
5.1.0                                
:
=== ./zivid-ros (git) ===                                                                                
v1.1.0

Potentially ideal condition

It'd be convenient if the output of vcs log --limit_untagged can be simplified when desired (maybe with an option).

Larger question

It's probably not difficult to change vcstool's code to add an option (haven't looked into it though) to achieve what's stated in the ideal condition. But that would add more leaf functionality and I'm afraid that would add more maintenance effort.

Changing custom verb so that it can accept back-tick would eliminate such a concern. Just an idea.

dirk-thomas commented 3 years ago

The backticks are being interpreted by the shell before vcstool is even invoked. So I don't see a way to achieve what you describe as the "ideal condition". I also wouldn't be a fan of passing an arbitrary expression string to vcstool which it then needs to evaluate.

Since #121 vcstool defaults to use --pretty=short. If you would like to contribute an extra option to choose e.g. a more compact formatting that would be great.