git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brad King <brad.king@kitware.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 3/3] commit-tree: teach -x <extra>
Date: Wed, 09 Nov 2011 17:19:00 -0500	[thread overview]
Message-ID: <4EBAFC54.1090403@kitware.com> (raw)
In-Reply-To: <1320872495-7545-4-git-send-email-gitster@pobox.com>

On 11/9/2011 4:01 PM, Junio C Hamano wrote:
> By feeding the header part of the original commit with this parameter,
> e.g. -x "$(git cat-file commit $commit | sed -n -e /^$/q -e p)", extra
> headers of another commit can be transplanted to the resulting commit.

One of the interface features typical in git plumbing that I've always liked
is that any place that can pass long strings tends to be implemented using
pipes or files, at least optionally.  This is especially helpful for operating
systems that have severe limitations on total command line size.

I suggest a flag (-X ?) that tells commit-tree to treat the commit message
(from wherever it is read) in "cat-file commit" format.  Read the extra
header lines from the part before the blank line, and the rest of the message
normally after the blank line.  For example:

  (git cat-file commit $commit | sed -n -e /^$/q -e p
   echo ''
   echo 'New commit message') |
  git commit-tree -X -p $parent $tree

If we want the original extended headers and the original message:

  git cat-file commit $commit | git commit-tree -X -p $parent $tree

-Brad

      reply	other threads:[~2011-11-09 22:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-09 21:01 [PATCH 0/3] commit-tree updates Junio C Hamano
2011-11-09 21:01 ` [PATCH 1/3] commit-tree: update the command line parsing Junio C Hamano
2011-11-09 21:01 ` [PATCH 2/3] commit-tree: teach -m/-F options to read logs from elsewhere Junio C Hamano
2011-11-09 21:01 ` [PATCH 3/3] commit-tree: teach -x <extra> Junio C Hamano
2011-11-09 22:19   ` Brad King [this message]

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=4EBAFC54.1090403@kitware.com \
    --to=brad.king@kitware.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).