From: Hugo Villeneuve Date: Fri, 28 Jun 2013 14:35:06 +0000 (-0400) Subject: git-hg-sub-import: Ajout des subrepos à .gitignore X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=b1c95e2300c56be57c770ec2e8e8a44db7c89995;p=hvutilities.git git-hg-sub-import: Ajout des subrepos à .gitignore --- diff --git a/scripts/git-hg-sub-import b/scripts/git-hg-sub-import index d5d947f..6d18dc3 100755 --- a/scripts/git-hg-sub-import +++ b/scripts/git-hg-sub-import @@ -53,6 +53,11 @@ if [ ! -f .hgsub ]; then exit 1 fi +if [ ! -f .gitignore ]; then + # We do not want to track .gitignore itself + echo ".gitignore" > .gitignore +fi + # Read lines from .hgsub while read sub; do # Remove CR (DOS) @@ -94,6 +99,11 @@ while read sub; do git checkout "branches/${branch}" cd .. fi + + if ! grep -q "${dest}" .gitignore ; then + # Ignore subrepo in top-level git repository + echo "${dest}" >> .gitignore + fi else pushd "${dest}" git pull