Mail Archives: geda-user/2014/03/18/12:05:18
On 03/18/2014 03:39 AM, Peter Stuge wrote:
> Hannu Vuolasaho wrote:
>> However I would like to see some git magic to happen and
>> when I click window about I would get date of the last commit
>> and commit ID. I sometimes forget to pull before make.
> A nice way is to call git describe --tags in the build scripts, and
> put the output in a #define.
>
>
> //Peter
>
>
The versioning stuff does get complicated, particularly when project
history is factored in. Git doesn't help since it does not maintain a
revision counter. However, this is really not very hard to fix. Use a
server side "post-receive" and "pre-receive" scripts to increment a
counter that is kept in a text file with the date of the push. This text
file would be located in the project's root directory. Each branch could
also have it's own independent counter. Then each time a group of
changes is pushed, the counter would be updated and time-stamped. Anyone
Pulling or Cloning the project would get the most recent revision count.
This data could then be used by the project to maintain and display the
version/revision data.
This fits really well with the classical 3 part version
(Major.Minor.Revision). Simply divide the count by 100 and use the
result as Minor.Revision. This would mean that each major version could
represent 10,000 pushes into the git repo and no Major version should
stay the same over that many revisions anyway. You might also be able
to make use of the Pre-Commit hook on the client side, but this has
other problems - i.e. Client side hooks are not part of clones,
checkouts, etc., not to mention that each copy of the Repository would
have it's own commit count. However, maintaining a "commit count" for
project history could be interesting. This could be done with a server
side hook that kept a log of all commit counts and a running total -
probably more trouble than it's worth.
Steve Besch
--
fictio cedit veritati
- Raw text -