1. Bitbucket
  2. Public Issue Tracker
  3. master

Issues

Issue #6628 resolved

Git "raw commit" feature should use git mbox format (BB-7813)

Marti R.
created an issue

On the single commit screen, there is a "raw commit" link. Currently when using that link in a Mercurial repository, it uses the "hg export" format, which includes commit message, authorship, date, time and other metadata.

The git raw commit feature, however, shows a plain old diff: https://bitbucket.org/intgr/pg_journal/commits/fc6d9ee81c812b59dbbbe57c7f22fe3d1b1f1a31/raw/

I believe it would be better to use the git mbox export format, produced by "git format-patch" -- which also preserves message, author, date etc.

Comments (9)

  1. Erik van Zijst staff

    I don't know. I don't like a "raw commit" link to produce an mbox like file with email headers.

    I do agree that it's be useful to have some more meta data in them, such as the SHA and the commit message. However, a patch should be a patch, not an email.

  2. Marti R. reporter

    Please understand, the "format-patch" format, also called the "mbox" format is the native git changeset format.

    It does include a plain text patch, just with extra metadata at the front, like "hg export". Please reconsider this and don't invent a custom format.

    This is what it looks like:

    From 6ce32d581e7ef434d9001dd9bcb5c848c0e15a87 Mon Sep 17 00:00:00 2001
    From: Marti Raudsepp <marti@juffo.org>
    Date: Mon, 11 Mar 2013 19:35:06 +0200
    Subject: [PATCH] Commit message here.
    
    ---
     bar | 1 +
     1 file changed, 1 insertion(+)
    
    diff --git a/bar b/bar
    index 257cc56..3bd1f0e 100644
    --- a/bar
    +++ b/bar
    @@ -1 +1,2 @@
     foo
    +bar
    -- 
    1.8.1.5
    

    This changeset can then be imported losslessly into another repository using "git am" (just like "hg import")

  3. Erik van Zijst staff

    Fair enough. We weren't going to invent a custom format, which is why we stuck with git's native diff output, but your reply did make me reconsider and I do agree it's worth looking at.

    I've raised an internal issue for this.

  4. Log in to comment