New Proposal (simple) for Metadata in Git Commits: git-meta

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

New Proposal (simple) for Metadata in Git Commits: git-meta

From: Sam Elliott <hidden>
Date: 2016-06-15 22:47:54

Hi,

I had this idea a day or so again, and have written a simple  
implementation to storing some semi-structured data in a git commit  
message. This means that it's much easier for data to be found and  
scraped from a certain commit, for instance what issue numbers commits  
refer to or close.

The entirety of the idea is expressed here: http://lenary.github.com/hackery/2009/12/git-meta/

I have so far built an implementation of a way to get the data out of  
a commit. I am still investigating how to get this info into the  
commit message before the git-commit command so that it doesn't have  
to be entirely hand-written.

I was just looking for feedback and to see whether the mailing list  
thinks this is a good idea or not? Any help would also be greatly  
appreciated.

Thanks!

Sam
--
Sam Elliott
sam@lenary.co.uk
--

Re: New Proposal (simple) for Metadata in Git Commits: git-meta

From: Shawn O. Pearce <hidden>
Date: 2016-06-15 22:47:54

Sam Elliott [off-list ref] wrote:
I had this idea a day or so again, and have written a simple  
implementation to storing some semi-structured data in a git commit  
message. This means that it's much easier for data to be found and  
scraped from a certain commit, for instance what issue numbers commits  
refer to or close.
So from your web page, this is basically just YAML shoved into the
footer of the message:

--8<--
	Written half of the functionality. Namely the querying half.

	---git-meta---
	awesome: true
	Github:
	  user: lenary
	---git-meta---
-->8--


Why do we need the --git-meta-- delimiter lines?

JGit and Gerrit Code Review have already been following Git tradition
by using footer messages as metadata.  E.g. we have lines like:

--8<--
    init: Don't abort on empty directory
    
    The following sequence should work:
    
      mkdir testgit
      java -jar gerrit.war init -d testgit
    
    Since testgit is empty, it should be acceptable for us to populate the
    directory with our files.
    
    Bug: issue 358
    Change-Id: Ia85f31802066f8d39b042d3d057d33950a5035fd
    Signed-off-by: Shawn O. Pearce [off-list ref]
-->8--

The JGit commit message parser has special logic to handle lines
that smell like one of these tag lines.  So long as there is no
blank line in the footer paragraph, each of these tags can be read
and processed.  Continuation lines should start with whitespace.

I don't remember my YAML well enough, but isn't this existing
standard still parseable by a YAML processor?

If you dropped the --git-meta-- tags above, JGit would happily
recognize the awesome: and Github: tags, but it might need a bit
more work to recognize the nested user: tag.  Also, you'd be able
to use git-meta on the git and Linux kernel repositories to pull
out and work with Signed-off-by, Acked-by, etc.

-- 
Shawn.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help