berkus / muddle

Automatically exported from code.google.com/p/muddle
0 stars 0 forks source link

Allow comments in stamp files #227

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
For two reasons:

1. It allows people to add comments like "# Use this stamp for purpose XXX"
   or "# This stamp is known to be broken because of YYY, so it won't build"

2. Currently, stamp files contain the date/time of generation. This is a nice
   idea, and very useful, but makes the SHA1 of two stamp files for the same
   tree, but generated at different times, not match. The solution given comments
   is to make the timestamp lines be comments, and ignore comments when calculating
   the SHA1.

   Note that this *would* cause two successive "muddle stamp save" operations
   generate the "same" file, since it is named by the SHA1 - but then, if they're
   identical, that is a Good Thing...

So, I propose to allow any line starting with a '#' to be regarded as a comment.
I do not propose to allow comments anywhere else (i.e., at the end of a 
non-blank line).

It may also be worth making blank lines (or lines composed entirely of 
whitespace) also be ignored when calculating the SHA1, since if someone *does* 
edit a file, it is easy to change this accidentally.

Is is a strict requirement that the comment start in column 0? or can there be 
leading whitespace? It's probably friendlier to allow leading whitespace:

    # This comment indented to make it stand out more
    # from the surroundings...

Original issue reported on code.google.com by t...@tibsnjoan.co.uk on 11 Jul 2012 at 1:10

GoogleCodeExporter commented 9 years ago
Fixed in 590953de99e991de4e8c048109a0282d71068526, on branch stamp-update, 
which will be merged into master when issue 226 has been resolved.

Stamp file timestamps are now written as comments - a stamp file now starts:

  # Muddle stamp file
  # Writen at 2012-01-29 17:55:40
  #           2012-01-29 17:55:40 UTC

Leading whitespace in front of '#' is allowed.

Original comment by t...@tibsnjoan.co.uk on 12 Jul 2012 at 10:17