Skip to contentSkip to conversation

Parseable commit header

DISCUSSION Stefan-W. Hahn 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hi,

after playing a while with git-pasky it is a crap to interpret the date of commit logs. Though it was a good idea to put the date in a parseable format (seconds since), but the format of the commit itself is not good parseable.

For easy converting the commit log header in readable format it should be in another format, perhaps like mail header:
- Every field should start al column zero wih filedname end up with a colon.
- Every fieldname starts with an upcase letter.
- The dates of author and committer should be fields of it own.
- The commit message itself is seperated by a blank line.

Example current log entry:

commit fe077e9d16819b72c275ea40b254f22b4d236f8b tree 98b57b0310e0e2309fe4a6c24a6abea31a4d6c6d parent f0adb6cf1bf603537afff5cf26b90e81321db225 author Petr Baudis <[email protected]> 1113684324 +0200 committer Petr Baudis <xpasky@machine> 1113684324 +0200

s/me/commit/ in git log output.

Should be:

Commit: fe077e9d16819b72c275ea40b254f22b4d236f8b
Tree: 98b57b0310e0e2309fe4a6c24a6abea31a4d6c6d
Parent: f0adb6cf1bf603537afff5cf26b90e81321db225
Author: Petr Baudis <[email protected]>
Author-Date: 1113684324 +0200
Committer: Petr Baudis <xpasky@machine>
Committer-Dater: 1113684324 +0200

s/me/commit/ in git log output.

This date entries are now easy parseable and convertable.

- Stefan

Signature · 2 lines
Stefan-W. Hahn                          It is easy to make things.
/ mailto:[email protected] /        It is hard to make things simple.			
#1 lore raw
Quoted 7 lines · Stefan-W. Hahn

Hi,

after playing a while with git-pasky it is a crap to interpret the date of commit logs. Though it was a good idea to put the date in a parseable format (seconds since), but the format of the commit itself is not good parseable.

Should be:

...

Quoted 1 line

Committer-Dater: 1113684324 +0200

I'm probably coming in late to the game, but exactly
why is seconds-since-epoch format used instead of a format more easily understood by humans? Yes, I know tools
can easily convert that, but you're already using an ASCII format; why not just record it in a format that's easily eyeballed like ISO's yyyymmddThhmmss [timezone]? E.G.:
20050417T171520 +0200
or some such? I'm SURE that people will mention things like "the patch I posted on April 17, 2005", and having the patch format record times that way, directly, would be convenient to the poor slobs^H^H^H^H^H developers who come later. Yes, a tool can handle the conversion, but choosing formats so a tool is unneeded for simple stuff is often better....!

--- David A. Wheeler

#2 lore raw
In reply to Stefan-W. Hahn
Quoted 4 lines · Stefan-W. Hahn

after playing a while with git-pasky it is a crap to interpret the date of commit logs. Though it was a good idea to put the date in a parseable format (seconds since), but the format of the commit itself is not good parseable.

Actually, it is. The commit stuff removes all special characters from the strings, so '<' and '>' around the email do indeed act as delimiters, and cannot exist anywhere else.

Linus