driusan / bug

Distributed bug tracking with the filesystem and hg or git
GNU General Public License v3.0
205 stars 7 forks source link

Add information about new/closed/updated issues to commit msg in git #10

Closed Komosa closed 8 years ago

Komosa commented 8 years ago

Instead of always-the-same commit message we can contain information about what was changed. Tests updated to support both old and new format (simple/rich ?).

codecov-io commented 8 years ago

Current coverage is 29.32%

Merging #10 into v0.4-dev will increase coverage by +5.37% as of 06e51e2

@@            v0.4-dev     #10   diff @@
========================================
  Files             26      26       
  Stmts            906     849    -57
  Branches          52      68    +16
  Methods            0       0       
========================================
+ Hit              217     249    +32
- Partial           19      24     +5
+ Missed           670     576    -94

Review entire Coverage Diff as of 06e51e2

Powered by Codecov. Updated on successful CI builds.

driusan commented 8 years ago

Sorry it took me so long to look at this!

It looks good, but two small things stand out:

  1. The parameter passed to Commit should already be the issues directory, so the git status/diff commands are already explicitly on that directory. There's no reason to check that it is (and if it is, such as in testing or when an environment variable is changing it), it's probably the intended behaviour that it's on that directory, and not the issues/ directory.
  2. I think instead of treating the Commit msg parameter as a backup, it should be treated as a subject (first line) for the commit, to ensure that it's easy to identify commits that came from bug when you're doing a git rebase -i, instead of having a commit subject that varies. I do like the idea of including more details in the message body, though.
Komosa commented 8 years ago

Ad2. I also appreciate that commit subjects created by bug are easily distinguishable from others. But I think, it will be also good to note differences among them.

Maybe some preffix will be best? Eg. bug:: bug: Updated issue "Proposal of more elaborate commit msg' subjects"

driusan commented 8 years ago

That seems like a reasonable compromise to me.. I'm not sure how it would scale to having multiple changes in the same commit, but my main concern is being able to easily identify commit messages that came from bug when rebasing.