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

Re: How to include the .git folder in a source package's .tar.xz archive?



On 29/10/2021 07:35, Tobias Frost wrote:
On Thu, Oct 28, 2021 at 09:02:21PM -0500, Hunter Wittenborn wrote:
The problem is that whenever I (and the other guy) build the program with
something like debuild, the resulting .tar.xz archive doesn't contain the
.git repository in which the 'debian/' folder is contained. I've attempted to
do some Googling, but I didn't get much of anywhere with it (I actually got
some answers on how to do the opposite for some reason :P).



Anything I could try?

For the packaging, I'd implement to retrieve the timestamp from d/changelog.
(e.g. using dpkg-parsechangleog). Possibly you want to prepare your build
system that it accepts injecting this timestamps.)

Note that the Debian packaging, when the maintainer uses git for that, resides
in its own git repository; even if it is now on the same place, this might
change (e.g. if package maintainer changes). Best is you consider that already
now and dont rely on the git repo.  to be (See
https://wiki.debian.org/UpstreamGuide#Pristine_Upstream_Source to keep debian/)



Other solutions could be creating a file like VERSION with relevant git data and add that to the distribution. That file can normally not be checked into git, it's a chicken and egg problem. The solution is to add the logic to autoconf/cmake/whatever is used.

Also, git has provisions for substituting keywords like date and hash when checking out data. However, this is in my opinion utterly messy to handle. See git-attributes(1)

--alec


Reply to: