Git development
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Denis Bueno <dbueno@gmail.com>
Cc: Miklos Vajna <vmiklos@frugalware.org>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: git cherry-pick before archive
Date: Fri, 11 Jul 2008 19:46:27 +0100 (BST)	[thread overview]
Message-ID: <alpine.DEB.1.00.0807111944000.8950@racer> (raw)
In-Reply-To: <6dbd4d000807111128l4721113dh3713bc7abd3d837e@mail.gmail.com>

Hi,

On Fri, 11 Jul 2008, Denis Bueno wrote:

> On Fri, Jul 11, 2008 at 14:25, Johannes Schindelin
> <Johannes.Schindelin@gmx.de> wrote:
> > Anyway, back to Denis' question: I could imagine (haven't tested,
> > thought), that "git revert -n <the-same-commit>" would undo the "git
> > cherry-pick -n".
> 
> So I need to be able to maintain the patch that is applied to the tree
> before archiving, so instead of a commit ID, I'm now using a patch
> file, and the sequence of actions is like so:
> 
>     $ <assume index is clean>
>     $ git apply --cached patchfile || exit 1
>     $ git archive --format=tar --prefix=pfx/ $(git write-tree) \
>           | gzip > prj.tgz
>     $ git reset
> 
> This way I don't even need to reverse-apply the patch, because I never
> touch the working copy.  Of course, this can't be done in this way in
> any other revision control system, because they don't have an index.

Well, they have.  They just do not expose it.

BTW in your case, I would suggest this:

	INDEX_FILE=.git/bla git read-tree HEAD &&
	INDEX_FILE=.git/bla git apply --cached patchfile &&
	INDEX_FILE=.git/bla git archive [...] &&
	rm .git/bla

IOW: Just use a temporary index for your work.

Ciao,
Dscho

  reply	other threads:[~2008-07-11 18:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-11 15:46 git cherry-pick before archive Denis Bueno
2008-07-11 15:51 ` Johannes Schindelin
2008-07-11 16:09   ` Denis Bueno
2008-07-11 16:11     ` Miklos Vajna
2008-07-11 16:18       ` Denis Bueno
2008-07-11 18:25       ` Johannes Schindelin
2008-07-11 18:28         ` Denis Bueno
2008-07-11 18:46           ` Johannes Schindelin [this message]
2008-07-11 18:49             ` Denis Bueno
2008-07-11 18:53               ` Johannes Schindelin
2008-07-11 22:18   ` Junio C Hamano

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=alpine.DEB.1.00.0807111944000.8950@racer \
    --to=johannes.schindelin@gmx.de \
    --cc=dbueno@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=vmiklos@frugalware.org \
    /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