[libvirt] [PATCH] Add a rule for generating .hgignore

Jim Meyering jim at meyering.net
Thu Jan 22 07:31:46 UTC 2009


john.levon at sun.com wrote:
> Add a rule for generating .hgignore
>
> diff --git a/Makefile.maint b/Makefile.maint
> --- a/Makefile.maint
> +++ b/Makefile.maint
> @@ -717,3 +717,5 @@ sync-vcs-ignore-files:
>  	mv $(c2g)-t $(c2g)
>  	perl $(c2g)
>  	rm -f $(c2g)
> +	find $(srcdir) -name .gitignore | xargs cat \
> +	    | sort -u | sed 's+\*+.*+' >.hgignore

There are a couple of problems when doing it that way:

  .gitignore uses glob syntax, while .hgignore uses regexps by default.
    You can use the "syntax: glob" directive to tell hg what to do.

  hoisting subdir-specific ignore directives all into a top-level
    .hgignore file is risky.  What if a generated (hence ignored) file
    in a subdirectory is also the name of something that must not be
    ignored at some other point in the tree?

The latter risk is why I made that rule generate one .gitignore
file alongside each .cvsignore file.




More information about the libvir-list mailing list