Re: squashing patches

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

 




If you want to pick several commits and squash them together, there is
"squash".  BUT there is no equivalent for "file" currently.
The only way to squash several patches together is with an external tool
like your favourite text editor, which is not fun but error-prone.
And there is no way to squash a commit (in the repo) and a patch (as file)
together (in exactly this order). The only thing is that you could run
sequencer twice and squash in the second move.

My feedback is in the message from the "-s theirs" thread that I CCed you on.

Basic points:

1) I would like a "--strategy" option for cherry-pick and for the sequencer's "pick";

2) What about

  mark :1
  pick a
  file b
  pick c
  squash --up-to :1

or, to specify a commit message

  mark :1
  file a
  pick b
  squash --up-to :1 -C HEAD^

or also

  mark :1
  file a
  pick b
  squash --up-to :1 -C HEAD^ -s

to merge all signoffs. This could be done by providing a stand-alone git-squash command; or alternatively, it could be done in the sequencer and the git-squash command would simply do

  (echo 'mark :1'
   git-rev-list --reverse $1.. | sed 's,^,pick '
   echo "squash --up-to :1 $*") | git-sequencer

after some option parsing.

3) I would like a totally batch mode-of-operation, which would fail if user intervention was needed (the user could choose whether to not edit the editor, or whether to use a no-op for GIT_EDITOR).

4) I think the sequencer is an opportunity to improve some commands, e.g. git-cherry-pick should grow more or less the same options as git-sequencer's pick.

Paolo
--
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]

  Powered by Linux