associate files with mercurial commits

40 Views Asked by At

I am thinking of a way to associate a single file with each mercurial commit I make. The content of this file can vary from

  1. Detailed multiline comments about the commit
  2. Problem solving methodology incase of bug-fixes

I understand that these can be individually be included into separate places. But, I want them here.

One other purpose of having such a file is to access it programmatically.

So my doubt is - Is it possible in Mercurial?

If so please explain the same.

Thanks in advance for your answers.

1

There are 1 best solutions below

0
On

To me that sounds like you want an elaborate commit message - they can be as detailed as you desire and are easily accessible and searchable with your mercurial tools.

You can give a file as elaborate multi-line commit message via hg commit -l FILENAME

Of course you could also simply add a file which you amend prior to each commit wherein you describe the changes and bug fixing methods for the commit you are about to make. Mercurial logs then will tell you which commit brought which changes to the file, thus giving you the connection between the content and the commit it refers to. However, while bug fix instructions might make sense in a file within the repository, the commit description and comments IMHO are better placed in the commit message itself.