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

Adding files to a git-archive when it is generated, and whats the best way to find out what branch a commit is on?

From
Ddemerphq <demerphq@gmail.com>
Date
Jul 29, 2009, 08:15 UTC
Message-ID
<9b18b3110907290115v1f30eeat748631bb09f92517@mail.gmail.com>

I was wondering if anybody had any suggestions on a sane way to add a file to a git-archive when it is being produced.

For instance build procedures that expect to be run inside of a git WD wont work if built from an archived version of the tree. Being able to provide a file of additional data to the archive package would be a very convenient way to work around this.

Ideally id like to be able to specify a set of additional files to include in the archive as part of the git-archive command line interface, but I'd be nearly as a happy with almost any solution other than the one I came up with, which is to use archive to generate a tar file, then use tar to append the additional files to the tar, and then compress it. This process turns out to be quite slow in comparison to producing a compressed archive directly from git-archive.

Another question is whether anyone has any advice on the best way to find out the "best" branch an arbitrary commit is on. Where best can be flexibly definied to handle commits that are reachable from multiple branches. I have hacked a solution involving git-log and grep, but it performs quite poorly. I was wondering if there is a better solution.

cheers, Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"
Next: Avery Pennarun
Message 1 of 14 in “Adding files to a git-archive when it is generated, and whats the best way to find out what branch a commit is on?”
  1. demerphqJul 29, 2009
  2. Avery PennarunJul 29, 2009
  3. Santi BéjarJul 29, 2009
  4. demerphqJul 29, 2009
  5. Santi BéjarJul 29, 2009
  6. demerphqJul 29, 2009
  7. Santi BéjarJul 29, 2009
  8. René ScharfeJul 30, 2009
  9. demerphqJul 31, 2009
  10. René ScharfeAug 2, 2009
  11. demerphqAug 2, 2009
  12. René ScharfeAug 4, 2009
  13. Jeff EplerJul 29, 2009
  14. demerphqJul 31, 2009

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.