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

add support for rendering branch name to git-standup #791

Closed
smeijer opened this issue Oct 29, 2019 · 10 comments
Closed

add support for rendering branch name to git-standup #791

smeijer opened this issue Oct 29, 2019 · 10 comments

Comments

@smeijer
Copy link

smeijer commented Oct 29, 2019

git standup shows my last commits. But a (long) list of commits, is not always useful to quickly aggregate my work from last week.

If we would be able to visualize the branch in this list, it would become much more useful.

Maybe even group commits under their branches?

feature/update-issue-templates
64a1426 - update templates (87 seconds ago) <Stephan Meijer>
1e00ba7 - update bug-fix.md (37 minutes ago) <Stephan Meijer>
29ffdbd - update feature.md (41 minutes ago) <Stephan Meijer>
1250ec1 - create enhancement.md (41 minutes ago) <Stephan Meijer>

feature/fix-login-bug
64a1426 - sigh... linter again (11 minutes ago) <Stephan Meijer>
29ffdbd - fix linter (12 minutes ago) <Stephan Meijer>
1e00ba7 - fix import statement (14 minutes ago) <Stephan Meijer>
@spacewander
Copy link
Collaborator

The problem to group the commits by branch is, commit doesn't belong to only one branch.

I have noticed you are using feature branch. These commits stay in the feature branch currently, but after they are merged, they will be in at least two branches: the original feature branch and the develop branch. Moreover, any newly created feature branches will also contain them. If the user doesn't even use feature branch, the result could be crazier.

It is hard to figure out how much branches a commit belongs to.

@smeijer
Copy link
Author

smeijer commented Oct 30, 2019

@spacewander, thanks. Everything you're saying makes sense. And yet, it would still be very helpful. Even when the same commit is being displayed under multiple branches.

Would it otherwise be possible to show branches that you've committed to in the last days instead? So don't list the commits under it? Just the branch names and maybe a timestamp of the last commit?

feature/update-issue-templates (87 seconds ago) <Stephan Meijer>
feature/fix-login-bug (11 minutes ago) <Stephan Meijer>

It's just because, I believe if git standup -a "author" would show me the branches author has worked on, it would be more informative than seeing the various commits sorted at commit date.

Exactly for the purpose of that function standup.

@spacewander spacewander added todo and removed wontfix labels Oct 30, 2019
@spacewander
Copy link
Collaborator

It is possible to make the output like

feature/update-issue-templates (87 seconds ago) <Stephan Meijer>
feature/fix-login-bug (11 minutes ago) <Stephan Meijer>

I will work on it once I have enough free time.

@spacewander
Copy link
Collaborator

@smeijer
I have submitted the pull request: #793.

By iterating all the branches and logging their commits, now we can group the commits by branches like this:

 $ git standup -B -a spacewander -d 7

    git-summary-cleanup
    f788c78 - git-summary: clean up other shellcheck warnings (23 hours ago) <spacewander>
    3e8c3ab - git-summary: fix incorrect active days when commits range is given (23 hours ago) <spacewander>
    ff991ac - git-summary: remove useless result function. (23 hours ago) <spacewander>
    203f5b4 - git-summary: add --dedup-by-email to remove duplicate users (5 days ago) <spacewander>
    master
    203f5b4 - git-summary: add --dedup-by-email to remove duplicate users (5 days ago) <spacewander>

Obviously, the same commit 203f5b4 is appeared both in the feature branch and in the master branch. I think it is OK if the user only wants to recall the changes made several days ago.

Could you try this feature and give us your feedback? You can use the commands below to update it:

git clone https://github.com/spacewander/git-extras -b git-standup-group-by-branch
cd git-extras && make install

@smeijer
Copy link
Author

smeijer commented Nov 1, 2019

@spacewander, awesome! Works like a charm. 😎 This is exactly what I needed.

Some improvements that could be made

  1. A newline before the branch name
λ git standup -B -a spacewander -d 7

git-standup-group-by-branch
7b9fbc4 - git-standup: add option '-B' to group the commits by branch (2 hours ago) <spacewander>
203f5b4 - git-summary: add --dedup-by-email to remove duplicate users (5 days ago) <spacewander>

master
f788c78 - git-summary: clean up other shellcheck warnings (25 hours ago) <spacewander>
3e8c3ab - git-summary: fix incorrect active days when commits range is given (26 hours ago) <spacewander>
ff991ac - git-summary: remove useless result function. (26 hours ago) <spacewander>
203f5b4 - git-summary: add --dedup-by-email to remove duplicate users (5 days ago) <spacewander>

ls
f788c78 - git-summary: clean up other shellcheck warnings (25 hours ago) <spacewander>
3e8c3ab - git-summary: fix incorrect active days when commits range is given (26 hours ago) <spacewander>
ff991ac - git-summary: remove useless result function. (26 hours ago) <spacewander>
203f5b4 - git-summary: add --dedup-by-email to remove duplicate users (5 days ago) <spacewander>
  1. Would it be possible to support a max number of commits per branch?
λ git standup -B 2 -a spacewander -d 7

git-standup-group-by-branch
7b9fbc4 - git-standup: add option '-B' to group the commits by branch (2 hours ago) <spacewander>
203f5b4 - git-summary: add --dedup-by-email to remove duplicate users (5 days ago) <spacewander>

master
f788c78 - git-summary: clean up other shellcheck warnings (25 hours ago) <spacewander>
3e8c3ab - git-summary: fix incorrect active days when commits range is given (26 hours ago) <spacewander>

ls
f788c78 - git-summary: clean up other shellcheck warnings (25 hours ago) <spacewander>
3e8c3ab - git-summary: fix incorrect active days when commits range is given (26 hours ago) <spacewander>
  1. If 2) is possible, than it also becomes useful without the -a flag, to render all authors. But that deserves a separate ticket I think.

With 2 + 3, it would be very useful for team leads during standup. But also to get a quick feeling of what your colleagues are working on.

@spacewander
Copy link
Collaborator

spacewander commented Nov 3, 2019

  1. git standup displays commits in the given time range. What is your use case for limiting the number of commits?
  2. You can use -a all to render all authors.

@smeijer
Copy link
Author

smeijer commented Nov 3, 2019

  1. To get a quick understanding of what's being worked on by the different team members. With -B the branch name helps me get an understanding. At that moment, I wouldn't need like 20 commits per branch any more.

I just want to get the understanding that John worked on feature/x while Jane was working on feature/y and feature/z.

The limiting would be nice to get a clear and clean overview.

Note that I do mean limiting per branch. So -B 2 can still result in 20 different commits. It would just lists only the 2 most recent ones under each branch name.

  1. Awesome! Thanks.

@spacewander
Copy link
Collaborator

@smeijer
Just push a new commit to #793 which adds the feature you'd like.

@smeijer
Copy link
Author

smeijer commented Nov 5, 2019

Used it this morning before standup, and I love it! Thank you so much.

git standup -B -a all -n 5

@spacewander
Copy link
Collaborator

Solved.

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

No branches or pull requests

2 participants