[Top][All Lists]

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

Re: [bug-libunistring] patch: augmented .gitignore files

From: Thien-Thi Nguyen
Subject: Re: [bug-libunistring] patch: augmented .gitignore files
Date: Mon, 04 May 2009 03:28:24 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

() Bruno Haible <address@hidden>
() Sun, 3 May 2009 16:07:59 +0200

   > +/autom4te.cache

   The autom4te.cache certainly should not be gitignored. Its presence can
   cause trouble in subsequent builds that is hard to track down. Take it as
   a reminder to arrange to remove this directory regularly, or prevent it
   from existing in the first place:

Thanks for the pointer; i wasn't aware of this autom4te feature.

   This does too much IMO. For example the rule to ignore "test-*" in all
   subdirectories of tests/ is clearly going to bite at some point.

All test-* files in all subdirectories are presently generated.  You can
prevent future surprises by documenting (in HACKING, not for end user) this
convention (and prohibiting manually written tests from using that filename
prefix).  If the tools change, the rule can change, then.

   So I tried to do it with less wildcards, see attached patch.

   But I'm still not happy with it, for two reasons:
     - The pattern *.o is too much: When I have files foo.o, zzz.o lying around,
       I want "git status" to remind me about them, so that I remove them.
     - The long list of compiled test files in tests/ will be tedious to 
       Essentially I have to copy the generated CLEANFILES file list from
       tests/Makefile.in to .gitignore. That does not seem right.

I address the second point above.  For the first point, is there some way to
distinguish foo.o, zzz.o from "normally ignorable" .o files?

   So, I actually *don't* want to put all file created by "make" and removed
   by "make distclean" into .gitignore.

Hmmm.  I understand what you say but not the reason behind it.  No worries.

   You have three ways to make "git status" useful for you in this situation:

     - Do "make distclean" always, before "git status". (That's what I do.)

I'll try this for a bit to see if my patience is up to it.

     - Always build in subdirectories, so-called VPATH builds. (Ralf seems to
       be doing this.)

Good point.

     - As explained in the example of "man gitignore", put the *.o and *.a
       ignore rules into .git/info/exclude. This actually makes more sense to
       me than putting them into .gitignore, because some users care about
       leftover .o files and some don't. .git/info/exclude is made by each
       user, whereas .gitignore is the same for all users.

Thanks for the tip.  With the patch you posted, and without modifying
.git/info/exclude, i see (in Emacs):

    untracked            lib/unistring/iconveh.h
    untracked            lib/unistring/localcharset.h
    untracked            lib/unistring/stdbool.h
    untracked            lib/unistring/stdint.h
    untracked            lib/unistring/version.h
    untracked            lib/unistring/woe32dll.h

FWIW, these were all mentioned in the lib/.gitignore in the original patch.
Do you consider these to be "normally ignorable"?


reply via email to

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