git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git cherry-pick before archive

From
Denis Bueno <dbueno@gmail.com>
Date
Jul 11, 2008, 18:28 UTC
Message-ID
<6dbd4d000807111128l4721113dh3713bc7abd3d837e@mail.gmail.com>
In-Reply-To
<alpine.DEB.1.00.0807111924180.8950@racer>

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.

-- 
 Denis
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 7 of 11 in “git cherry-pick before archive”
  1. Denis BuenoJul 11, 2008
  2. Johannes SchindelinJul 11, 2008
  3. Denis BuenoJul 11, 2008
  4. Miklos VajnaJul 11, 2008
  5. Denis BuenoJul 11, 2008
  6. Johannes SchindelinJul 11, 2008
  7. Denis BuenoJul 11, 2008
  8. Johannes SchindelinJul 11, 2008
  9. Denis BuenoJul 11, 2008
  10. Johannes SchindelinJul 11, 2008
  11. Junio C HamanoJul 11, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.