All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Martin Fick <mfick@codeaurora.org>
Cc: james.moger@gitblit.com, Thomas Koch <thomas@koch.ro>,
	Jeremy Rosen <jeremy.rosen@openwide.fr>,
	git@vger.kernel.org, Shawn Pearce <spearce@spearce.org>
Subject: Re: RFE: support change-id generation natively
Date: Tue, 22 Oct 2013 12:50:31 -0700	[thread overview]
Message-ID: <xmqqy55lrsoo.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <201310211249.49568.mfick@codeaurora.org> (Martin Fick's message of "Mon, 21 Oct 2013 12:49:49 -0600")

Martin Fick <mfick@codeaurora.org> writes:

> As a Gerrit maintainer, I would suspect that we would 
> welcome a way to track "changes" natively in git.

I would suspect that we would not mind "git commit --change-id" (and
probably "git commit-tree --change-id") option that can be used to
tell the command to add a new Change-Id: trailer at the end, if and
only if there is none in the log message to be recorded (this needs
to happen after the user possibly edits).  We may even want to
introduce commit.changeId boolean configuration variable if we did
so.

"git commit --amend", "git rebase", etc. can be left oblivious to
the "Change-Id:" trailer, as the default mode of operation you guys
want is to leave the existing one as-is, unless the end user really
wants to change it, I think.

It would be just the matter of updating commit_tree_extended() in
commit.c to:

 - detect the need to add a new Change-Id: trailer;

 - call hash_sha1_file() on the commit object buffer (assuming that
   a commit object that you can actually "git cat-file commit" using
   the change Id does not have to exist anywhere for Gerrit to
   work---otherwise you would need to call write_sha1_file()
   instead) before adding Change-Id: trailer;

 - add Change-Id: trailer to the buffer; and then finally

 - let the existing write_sha1_file() to write it out.

I would think.  You might have a funny chicken-and-egg problem with
the signed commit, though.  I didn't think that part through.

  reply	other threads:[~2013-10-22 19:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-21 14:48 RFE: support change-id generation natively james.moger
2013-10-21 14:51 ` Jeremy Rosen
2013-10-21 15:41   ` james.moger
2013-10-21 16:35     ` Shawn Pearce
2013-10-21 16:38       ` Ondřej Bílka
2013-10-21 23:07         ` Shawn Pearce
2013-10-21 18:29     ` Thomas Koch
2013-10-21 18:40       ` james.moger
2013-10-21 18:49         ` Martin Fick
2013-10-22 19:50           ` Junio C Hamano [this message]
2013-10-22 20:06             ` Pyeron, Jason J CTR (US)
2013-10-22 20:43               ` Junio C Hamano
2013-10-23  6:36             ` Duy Nguyen
2013-10-23 16:00               ` Junio C Hamano
2013-10-24  2:07                 ` Duy Nguyen
2013-10-24  4:11                   ` Nasser Grainawi
2013-10-24  5:25                     ` Duy Nguyen
2013-10-24  6:01                       ` Johannes Sixt
2013-10-24 12:11                         ` james.moger
2013-10-24 12:51                           ` Thomas Koch
2013-10-24 13:31                           ` Duy Nguyen
2013-10-24 20:04                         ` Junio C Hamano
2013-10-25  6:37                           ` Johannes Sixt
2013-10-21 23:10         ` Shawn Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqy55lrsoo.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=james.moger@gitblit.com \
    --cc=jeremy.rosen@openwide.fr \
    --cc=mfick@codeaurora.org \
    --cc=spearce@spearce.org \
    --cc=thomas@koch.ro \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.