Andrew Lank
Andrew Lank

Reputation: 1617

git commit searches source and extracts comments

I'm just wondering, say in my sources I were to write some kind of comment like

# .GIT: Fixed da big bug man!

So these might appear here and there in various source files with detailed explanations (as in the example!).

Then on git commit it would first scan all the sources, extract those comments for the commit message and commit it. Extra would be to remove those comments form the source files (ya a little dangerous but hey, live on the edge).

Does this make sense? Is there something already out there for say the hooks? I would have thought it a popular request but unless I'm searching the wrong keywords, I've found nothing. Or is this a really, really bad idea or impossible?

And yes, as you guessed it I'm new to git.

Upvotes: 2

Views: 65

Answers (1)

Lazy Badger
Lazy Badger

Reputation: 97395

  1. It's possible (witrh some tricks, yes)
  2. It can be done with hooks (precommit at least)
  3. Yes, it have not sense and it's bad idea and result of dirty chaotic workflow and poor planning

All and any commit (and developer behind scene) must follow paradigm "Commit often! Commit fast!" and if you use "commit per atomic job" or lesser (one job may be affected in some amount of commits) idea, you can not write and combine in commit message done-list

Upvotes: 2

Related Questions