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

git-archive for files changed in revision range

From
GCGraham Cox <graham@grahamcox.co.uk>
Date
Feb 13, 2008, 13:03 UTC
Message-ID
<20080213130304.GA19957@grahamcox.co.uk>
Hiya,

We have a small project that is being managed in a Git repository (MSysGit to be exact) - mostly for backups and so on. The project is a mod for the computer game Civilization 4. (Actually a mod of a mod, but still...) As such, to release the mod to other people to actually use the only thing that needs to be released is all of the files that have actually been changed. (The actual git repository contains ~700MB of files, the vast majority of which haven't changed since the initial import and so don't need to be downloaded by people).

I've managed to make it produce an archive that contains only the files that have changed by using a combination of git-archive and git-whatchanged, along with grep and sed, but it's kinda unwieldly. Is there a better way of doing this?

The command line I used was something like (This is mostly from memory):
git-archive --format=zip . `git-whatchanged <start>..HEAD --pretty=oneline 
  | grep '^:' | sed 's/^.*\t//'` > release.zip

To produce a zip containing all of the modified and added files for the revision range <start>..HEAD.

-- 
Graham Cox
Next: Johannes Schindelin
Message 1 of 4 in “git-archive for files changed in revision range”
  1. Graham CoxFeb 13, 2008
  2. Johannes SchindelinFeb 13, 2008
  3. Jeff KingFeb 13, 2008
  4. Johannes SixtFeb 13, 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.