Use .gitignore in addition to .hgignore
Created originally on Bitbucket by moi90 (Martin Schröder)
It would be wunderful, if one had not to maintain two .ignore files.
Created originally on Bitbucket by moi90 (Martin Schröder)
It would be wunderful, if one had not to maintain two .ignore files.
Created originally on Bitbucket by audriusk (Audrius Kažukauskas)
It would be a nice addition, but it's already possible to automate creation of .hgignore (at least on Unix-like systems, not sure about Windows). You need to put somewhere in your PATH
the following shell script:
#!sh
#!/bin/bash
printf "syntax: glob\n.hgignore\n" | cat - .gitignore > .hgignore
Then inside your repo add this to .hg/hgrc
:
#!ini
[hooks]
update = create-hgignore
# Or whatever the name was given to the script.
Now whenever update or merge is run, the script will regenerate the contents of .hgignore.
Created originally on Bitbucket by moi90 (Martin Schröder)
Ah, that is nice! Thanks for the hint!
Created originally on Bitbucket by kiwidrew (Andrew Tipton)
Unsurprisingly, it turns out that the .gitignore semantics are far more complicated than just adding a "syntax: glob" line... there can be multiple .gitignores spread throughout the tree, and the patterns are relative to their containing file's directory. See my pull request #19 (closed) for a helpful build-hgignore.py script that attempts to handle all of this.