{"thread":{"id":"10862","subject":"[PATCH] git-clean: consider core.excludesfile","startedAt":"2007-11-14T07:40:33Z","lastAt":"2007-11-14T10:02:59Z","messageCount":5,"participants":["shunichi fuji","Junio C Hamano","Jakub Narebski","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"59820","messageId":"30046e3b0711132340y2c503dd4laea24b9b1c79a160@mail.gmail.com","threadId":"10862","inReplyTo":null,"subject":"[PATCH] git-clean: consider core.excludesfile","fromName":"shunichi fuji","fromEmail":"palglowr@gmail.com","sentAt":"2007-11-14T07:40:33Z","receivedAt":"2007-11-14T07:40:33Z","isPatch":true,"sender":{"key":"palglowr@gmail.com","avatar":null},"body":"git-clean used \"git ls-files\" and \"git ls-files\" don't consider\ncore.excludesfile.\ni add few lines.\n\n--- /usr/bin/git-clean  2007-11-14 08:26:20.000000000 +0900\n+++ git-clean   2007-11-14 09:43:03.000000000 +0900\n@@ -81,9 +81,14 @@\n       if [ \"$ignoredonly\" ]; then\n               excl=\"$excl --ignored\"\n       fi\n+       core_excl=\"`git-config core.excludesfile`\"\n+       if [ -f \"$core_excl\" ]; then\n+               core_excl_info=\"--exclude-from=$core_excl\"\n+       fi\n fi\n\n-git ls-files --others --directory $excl ${excl_info:+\"$excl_info\"} -- \"$@\" |\n+git ls-files --others --directory $excl ${excl_info:+\"$excl_info\"} \\\n+${core_excl_info:+\"$core_excl_info\"} -- \"$@\" |\n while read -r file; do\n       if [ -d \"$file\" -a ! -L \"$file\" ]; then\n               if [ -z \"$cleandir\" ]; then\n"},{"id":"59829","messageId":"7v4pfpkxtf.fsf@gitster.siamese.dyndns.org","threadId":"10862","inReplyTo":"30046e3b0711132340y2c503dd4laea24b9b1c79a160@mail.gmail.com","subject":"Re: [PATCH] git-clean: consider core.excludesfile","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-14T08:58:52Z","receivedAt":"2007-11-14T08:58:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.  Sign-off please?\n"},{"id":"59835","messageId":"fheg1c$eh8$1@ger.gmane.org","threadId":"10862","inReplyTo":"30046e3b0711132340y2c503dd4laea24b9b1c79a160@mail.gmail.com","subject":"Re: [PATCH] git-clean: consider core.excludesfile","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-11-14T09:44:19Z","receivedAt":"2007-11-14T09:44:19Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"shunichi fuji wrote:\n\n> +       core_excl=\"`git-config core.excludesfile`\"\n\n  +       core_excl=\"$(git-config core.excludesfile)\"\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"59839","messageId":"7vzlxhi23g.fsf@gitster.siamese.dyndns.org","threadId":"10862","inReplyTo":"30046e3b0711132340y2c503dd4laea24b9b1c79a160@mail.gmail.com","subject":"[PATCH] git-clean: honor core.excludesfile","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-14T09:54:43Z","receivedAt":"2007-11-14T09:54:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"git-clean did not honor core.excludesfile configuration\nvariable, although some other commands such as git-add and\ngit-status did.  Fix this inconsistency.\n\nOriginal report and patch from Shun'ichi Fuji.  Rewritten by me\nand bugs and tests are mine.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * How does this look?  It is customary here to add a test\n   script to t/ to make sure a fix won't get broken in later\n   changes, so I took the liberty of adding one myself.\n\n git-clean.sh     |    9 ++++++++-\n t/t7300-clean.sh |   11 +++++++++++\n 2 files changed, 19 insertions(+), 1 deletions(-)\n\ndiff --git a/git-clean.sh b/git-clean.sh\nindex 4491738..931d1aa 100755\n--- a/git-clean.sh\n+++ b/git-clean.sh\n@@ -75,15 +75,22 @@ esac\n \n if [ -z \"$ignored\" ]; then\n \texcl=\"--exclude-per-directory=.gitignore\"\n+\texcl_info= excludes_file=\n \tif [ -f \"$GIT_DIR/info/exclude\" ]; then\n \t\texcl_info=\"--exclude-from=$GIT_DIR/info/exclude\"\n \tfi\n+\tif cfg_excl=$(git config core.excludesfile) && test -f \"$cfg_excl\"\n+\tthen\n+\t\texcludes_file=\"--exclude-from=$cfg_excl\"\n+\tfi\n \tif [ \"$ignoredonly\" ]; then\n \t\texcl=\"$excl --ignored\"\n \tfi\n fi\n \n-git ls-files --others --directory $excl ${excl_info:+\"$excl_info\"} -- \"$@\" |\n+git ls-files --others --directory \\\n+\t$excl ${excl_info:+\"$excl_info\"} ${excludes_file:+\"$excludes_file\"} \\\n+\t-- \"$@\" |\n while read -r file; do\n \tif [ -d \"$file\" -a ! -L \"$file\" ]; then\n \t\tif [ -z \"$cleandir\" ]; then\ndiff --git a/t/t7300-clean.sh b/t/t7300-clean.sh\nindex eb0847a..0ed4ae2 100755\n--- a/t/t7300-clean.sh\n+++ b/t/t7300-clean.sh\n@@ -177,4 +177,15 @@ test_expect_success 'clean.requireForce and -f' '\n \n '\n \n+test_expect_success 'core.excludesfile' '\n+\n+\techo excludes >excludes &&\n+\techo included >included &&\n+\tgit config core.excludesfile excludes &&\n+\toutput=$(git clean -n excludes included 2>&1) &&\n+\texpr \"$output\" : \".*included\" >/dev/null &&\n+\t! expr \"$output\" : \".*excludes\" >/dev/null\n+\n+'\n+\n test_done\n"},{"id":"59840","messageId":"473AC7D3.3000801@viscovery.net","threadId":"10862","inReplyTo":"30046e3b0711132340y2c503dd4laea24b9b1c79a160@mail.gmail.com","subject":"Re: [PATCH] git-clean: consider core.excludesfile","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2007-11-14T10:02:59Z","receivedAt":"2007-11-14T10:02:59Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"shunichi fuji schrieb:\n> --- /usr/bin/git-clean  2007-11-14 08:26:20.000000000 +0900\n> +++ git-clean   2007-11-14 09:43:03.000000000 +0900\n> @@ -81,9 +81,14 @@\n>        if [ \"$ignoredonly\" ]; then\n>                excl=\"$excl --ignored\"\n>        fi\n> +       core_excl=\"`git-config core.excludesfile`\"\n\nPlease make this\n\n\tcore_excl=$(git-config core.excludesfile)\n\n-- Hannes\n"}]}