Re: git-archive for files changed in revision range

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

 



On Wed, Feb 13, 2008 at 01:03:04PM +0000, Graham Cox wrote:

> 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

That will list files multiple times if they were modified in more than
one commit. And really, there's no need to walk the history. You really
are just comparing against two points (your baseline and your current
state). Walking the history will also erroneously include files which
changed, but then reverted back to their original state (though I expect
that is the uncommon case).

How about:

  # mark our start point for this and future releases
  git tag baseline `git rev-list HEAD | tail -n 1`

  # find files which differ between then and now; but we only need
  # to care about added and modified files, since deleted ones
  # don't need to be shipped
  git diff --diff-filter=AM --raw baseline HEAD | awk '{print $6}' >files

  # and archive
  git archive --format=zip HEAD `cat files`

You can even use diff's "-z" option if you have filenames that are hard
to quote, but I will leave that as an exercise to the reader.

-Peff
-
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