Re: [PATCH 3/3] commit-tree: teach -x <extra>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]