# Extra metadata in the commit?

5 messages from 2009-04-24 to 2009-04-25. Participants: Scott Chacon, Junio C Hamano, Johannes Schindelin, Alex Riesen, Johan Herland.
Thread: https://gitlist.dev/t/19054

## Scott Chacon, 2009-04-24 22:47

Subject: Extra metadata in the commit?
Message-ID: <d411cc4a0904241547p64c0af2bycae20cd4b26e43f6@mail.gmail.com>
URL: https://gitlist.dev/e/d411cc4a0904241547p64c0af2bycae20cd4b26e43f6%40mail.gmail.com

```
Hey all,

I'm working on a hg<->git bidirectional tool using Git as the
communication protocol, so there is a bunch of Hg metadata that I need
to keep in Git to ensure I can convert commits created in Hg back into
the exact same objects after they upload to the Git db and then come
back down.  This means storing explicit rename info, branch names, etc
somewhere without messing up Git clients that want to work on the same
repo.  So, I can keep this data in the commit message, but I thought
it would be cleaner to keep it as extra fields in the commit object
before the "\n\n" separator.  Before I go too far down this road, is
there anything horrible that might happen in any of the core Git tools
if extra data is there?

Thanks,
Scott

```

## Junio C Hamano, 2009-04-24 23:06

Subject: Re: Extra metadata in the commit?
Message-ID: <7vws998xdf.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vws998xdf.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <d411cc4a0904241547p64c0af2bycae20cd4b26e43f6@mail.gmail.com>

```
Scott Chacon <schacon@gmail.com> writes:

> I'm working on a hg<->git bidirectional tool using Git as the
> communication protocol, so there is a bunch of Hg metadata that I need
> to keep in Git to ensure I can convert commits created in Hg back into
> the exact same objects after they upload to the Git db and then come
> back down.  This means storing explicit rename info, branch names, etc
> somewhere without messing up Git clients that want to work on the same
> repo.  So, I can keep this data in the commit message, but I thought
> it would be cleaner to keep it as extra fields in the commit object
> before the "\n\n" separator.  Before I go too far down this road, is
> there anything horrible that might happen in any of the core Git tools
> if extra data is there?

Not that I know of but it is highly unlikely that such a patch will be
accepted, given the history of discussion around that area.

```

## Johannes Schindelin, 2009-04-24 23:55

Subject: Re: Extra metadata in the commit?
Message-ID: <alpine.DEB.1.00.0904250154080.10279@pacific.mpi-cbg.de>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0904250154080.10279%40pacific.mpi-cbg.de
In-Reply-To: <d411cc4a0904241547p64c0af2bycae20cd4b26e43f6@mail.gmail.com>

```
Hi,

On Fri, 24 Apr 2009, Scott Chacon wrote:

> I'm working on a hg<->git bidirectional tool using Git as the 
> communication protocol, so there is a bunch of Hg metadata that I need 
> to keep in Git to ensure I can convert commits created in Hg back into 
> the exact same objects after they upload to the Git db and then come 
> back down.  This means storing explicit rename info, branch names, etc 
> somewhere without messing up Git clients that want to work on the same 
> repo.  So, I can keep this data in the commit message, but I thought it 
> would be cleaner to keep it as extra fields in the commit object before 
> the "\n\n" separator.

I'd suggest keeping it in the commit body, for better visibility and 
easier handling by tools.

Ciao,
Dscho

```

## Alex Riesen, 2009-04-25 09:49

Subject: Re: Extra metadata in the commit?
Message-ID: <81b0412b0904250249k717ae07did24867bd6ca6e8a2@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0904250249k717ae07did24867bd6ca6e8a2%40mail.gmail.com
In-Reply-To: <alpine.DEB.1.00.0904250154080.10279@pacific.mpi-cbg.de>

```
2009/4/25 Johannes Schindelin <Johannes.Schindelin@gmx.de>:
> On Fri, 24 Apr 2009, Scott Chacon wrote:
>
>> I'm working on a hg<->git bidirectional tool using Git as the
>> communication protocol, so there is a bunch of Hg metadata that I need
>> to keep in Git to ensure I can convert commits created in Hg back into
>> the exact same objects after they upload to the Git db and then come
>> back down.  This means storing explicit rename info, branch names, etc
>> somewhere without messing up Git clients that want to work on the same
>> repo.  So, I can keep this data in the commit message, but I thought it
>> would be cleaner to keep it as extra fields in the commit object before
>> the "\n\n" separator.
>
> I'd suggest keeping it in the commit body, for better visibility and
> easier handling by tools.
>

BTW, by the same convention we treat the very first line of a commit
message specially, we can say that the last line, if non-empty
(IOW, does not end with \n), is treated specially by UI tools
(grayed out, for example):

  Subject\n
  \n
  Body\n
  \n
  something:very:special

```

## Johan Herland, 2009-04-25 12:08

Subject: Re: Extra metadata in the commit?
Message-ID: <200904251408.22410.johan@herland.net>
URL: https://gitlist.dev/e/200904251408.22410.johan%40herland.net
In-Reply-To: <alpine.DEB.1.00.0904250154080.10279@pacific.mpi-cbg.de>

```
On Saturday 25 April 2009, Johannes Schindelin wrote:
> On Fri, 24 Apr 2009, Scott Chacon wrote:
> > So, I can keep this data in the commit message, but I thought it
> > would be cleaner to keep it as extra fields in the commit object before
> > the "\n\n" separator.
>
> I'd suggest keeping it in the commit body, for better visibility and
> easier handling by tools.

Or even better: Keep it in separate commit notes (provided you can wait for 
the js/notes topic in pu to make it into a release). If you add the notes 
with GIT_NOTES_REF=refs/notes/hg_metadata, you will also keep them nicely 
out of the way of everybody else.

(I'm using this approach when building a bidirectional CVS <-> Git helper on 
top of Barkalow's foreign-scm topic).


Have fun! :)

...Johan

-- 
Johan Herland, <johan@herland.net>
www.herland.net

```
