automake-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] {maint} repo: don't commit generated files in the git reposi


From: Jim Meyering
Subject: Re: [PATCH] {maint} repo: don't commit generated files in the git repository anymore
Date: Fri, 09 Dec 2011 17:11:31 +0100

Stefano Lattarini wrote:
> Hi Jim.
>
> On Friday 09 December 2011, Jim Meyering wrote:
>> > On 12/09/2011 10:17 AM, Stefano Lattarini wrote:
>> >> Another patch to be applied after the 1.11.2 release.
>> >>
>> >> While conceptually very simple, this patch is quite large in size,
>> >> since the diffs contain all the text of the removed configure and
>> >> Makefile.in files; so I've attached it compressed.
>> >>
>> >> repo: don't commit generated files in the git repository anymore
>>
>> Thank you, Stefano!
>> Automake has been a bit of a laggard on this front.
>> It has been annoying (and slightly risky) to see my infrequent diff
>> output buried under pages of spurious "git diff" output from all of
>> those generated-yet-VC'd files.
>>
> Still, such "extra diffs" had their upsides too.  Automake has (had?)
> the policy of always regenerating its 'Makefile.in's with the "latest"
> developement version of itself before committing them; thus, reviewing
> the diffs of such regenerated 'Makefile.in's before committing could
> (and sometimes, in fact, did) reveal bugs and blunders missed by code
> review and by the testsuite.
>
> So, before applying this patch, I'd like to create a new script or
> Makefile rule that would offer a similar functionality.  As usual,
> suggestions welcome,.

I would suggest to keep the generated files on a separate branch
just for them (i.e., with no other content), and autogenerate, and
auto-commit/push to that branch whenever a change in generated file is
induced by a change on the primary branch.

A lighter-weight and private tracking solution would be to do something
like this, which I added to diffutils' cfg.mk (accidentally committed, it
seems) almost two years ago.  This tracks changes to some autoconf-generated
files and filters out predictable diffs:

_cf_state_dir ?= .config-state
_date_time := $(shell date +%F.%T)
config-compare:
        diff -u                                 \
          -I'define VERSION '                   \
          -I'define PACKAGE_VERSION '           \
          -I'define PACKAGE_STRING '            \
          $(_cf_state_dir)/latest lib/config.h
        diff -u                                 \
          -I'$(PACKAGE_NAME)'                   \
          -I'[SD]\["VERSION"\]'                 \
          -I'[SD]\["PACKAGE_VERSION"\]'         \
          -I'D\["PACKAGE_STRING"\]'             \
          $(_cf_state_dir)/latest config.status

config-save:
        $(MAKE) --quiet config-compare > /dev/null 2>&1 \
          && { echo no change; exit 1; } || :
        mkdir -p $(_cf_state_dir)/$(_date_time)
        ln -nsf $(_date_time) $(_cf_state_dir)/latest
        cp lib/config.h config.status $(_cf_state_dir)/latest



reply via email to

[Prev in Thread] Current Thread [Next in Thread]