You are not logged in.

#1 2012-12-12 17:34:01

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 5,699
Website

git: How can I include untracked files in exported archives?

I have a git repo with man pages written in markdown. I use a script to generate nroff man pages from those files that I would like to include in the exported archive, but I do not want to track them with Git because it would be redundant, and I only really need them in the archive.

What is the best way to include them?

I'm still a Git noob, so maybe I'm thinking about this the wrong way. I wish there was an "export-include" option for .gitattributes. So far it seems that I might be able to do this with the filter option using custom clean and smudge commands, but that would probably be a dirty hack.

Any ideas?

Offline

#2 2012-12-13 00:04:42

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 3,731

Re: git: How can I include untracked files in exported archives?

Don't ship them and just generate them at build/install time?


Evil #archlinux@freenode channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#3 2012-12-13 00:27:30

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,096
Website

Re: git: How can I include untracked files in exported archives?

mkinitcpio essentially does this for its dist target in the Makefile.

Offline

#4 2012-12-13 08:03:56

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 5,699
Website

Re: git: How can I include untracked files in exported archives?

@Mr.Elendig
That's not an option because the conversion requires pandoc and making that a build dependency would be unreasonable in this case.

@falconindy
If I have understood that correctly, it's appending the archives to the exported archive. I will do it that way if there truly is no way to do it directly with Git.


Thanks for the replies.

Offline

#5 2012-12-18 06:07:39

bsilbaugh
Member
From: Maryland, USA
Registered: 2011-11-15
Posts: 141

Re: git: How can I include untracked files in exported archives?

Might it be easier to directly use tar or gzip? For example,

tar --exclude-vcs --czvf your_project-X.Y.Z.tgz your_project

If your project directory contains additional files that you don't want in the package, you could explicitly filter those out using the --exclude option.

Autoconf/Automake can also be used to create dist packages (archives). I seem to recall that it allowed one to specify additional "data" to be included with the source.


- Good judgement comes from experience; experience comes from bad judgement. -- Mark Twain
- There's a remedy for everything but death. -- The wise fool, Sancho Panza
- The purpose of a system is what it does. -- Anthony Stafford Beer

Offline

#6 2012-12-18 20:00:27

Xyne
Moderator/TU
Registered: 2008-08-03
Posts: 5,699
Website

Re: git: How can I include untracked files in exported archives?

@bsilbaugh
That's basically what I do with untracked projects. I don't want to do that with Git because this really is what Git archive is supposed to do (imo). The .gitignore file already tracks exclusions. Keeping that information in two places or writing a git-to-tar parser to extract it would just lead to unnecessary duplication and maintenance complexity.

So far I think I'll just use a script to append the desired file to the archive after export. When I get some time I may try to add an "archive-include" option to git.

Offline

Board footer

Powered by FluxBB