[PATCH] using .gitignore file should use glob as default syntax
benk at berkeley.edu
Tue Feb 5 15:44:38 CST 2013
Thanks! I appreciate the feedback.
On Tue, Feb 5, 2013 at 1:41 PM, Kevin Bullock <
kbullock+mercurial at ringworld.org> wrote:
> On Feb 5, 2013, at 2:55 PM, Ben Kehoe wrote:
> > # HG changeset patch
> > # User Ben Kehoe <benk at berkeley.edu>
> > # Date 1359580170 28800
> > # Node ID 0b5ff522049db893f4d1afb2030cd721f8e17761
> > # Parent 1516d5624a2911fcb90ee051c6dc0679b49aef55
> > using .gitignore file should use glob as default syntax
> > .gitignore files use glob syntax instead of regexp.
> > When a repo is configured to use a custom ignore file named .gitignore,
> > should be parsed using relglob syntax. This is implemented by adding a
> > default syntax parameter to ignorepats(), which when passed as None keeps
> > the current behavior. In readpats(), files named exactly '.gitignore'
> > 'relglob' to ingorepats() as the default syntax.
> > Tests are added to verify the behavior.
> > This patch will work in concert with a patch to hg-git to automatically
> > the .gitignore file if it exists.
> I think this is unwise. gitignore glob syntax and semantics are
> different from hgignore. In particular, gitignore globs are relative to
> the .gitignore file (which also needn't be at the repo root!); globs in
> hgignore aren't rooted to anything.
> : http://www.kernel.org/pub/software/scm/git/docs/gitignore.html
> : http://www.selenic.com/hg/help/ignore
> This also isn't what the ui.ignore config option is intended for; it's
> meant to specify per-*user* ignore files. Mercurial doesn't provide a way
> for you to specify an alternate ignore file for a *repository* -- and using
> ui.ignore to do this will lead you to pain when you forget to configure it
> on one of your clones.
> What would be better is a hunk of code to automatically convert a
> .gitignore file into an .hgignore file. (I've been wanting this for a
> while, probably for the same reasons you wrote this patch.)
> pacem in terris / мир / शान्ति / سَلاَم / 平和
> Kevin R. Bullock
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mercurial-devel