{"thread":{"id":"25770","subject":"[PATCH] git-gui: use --exclude-standard to check for untracked files","startedAt":"2010-11-17T15:13:24Z","lastAt":"2010-11-29T13:33:39Z","messageCount":2,"participants":["Stefan Naewe","Stefan Näwe"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"156052","messageId":"1290006804-9142-1-git-send-email-stefan.naewe@googlemail.com","threadId":"25770","inReplyTo":null,"subject":"[PATCH] git-gui: use --exclude-standard to check for untracked files","fromName":"Stefan Naewe","fromEmail":"stefan.naewe@googlemail.com","sentAt":"2010-11-17T15:13:24Z","receivedAt":"2010-11-17T15:13:24Z","isPatch":true,"sender":{"key":"stefan.naewe@gmail.com","avatar":"https://avatars.githubusercontent.com/u/4468?v=4"},"body":"This fixes git gui failing to display untracked files if\ncore.excludesfile is set to '~/.gitexcludes'.\n\nSigned-off-by: Stefan Naewe <stefan.naewe@googlemail.com>\n---\n git-gui/git-gui.sh |    9 +--------\n 1 files changed, 1 insertions(+), 8 deletions(-)\n\ndiff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh\nindex 4617f29..7121526 100755\n--- a/git-gui/git-gui.sh\n+++ b/git-gui/git-gui.sh\n@@ -1428,14 +1428,7 @@ proc rescan_stage2 {fd after} {\n \t\tclose $fd\n \t}\n \n-\tset ls_others [list --exclude-per-directory=.gitignore]\n-\tif {[have_info_exclude]} {\n-\t\tlappend ls_others \"--exclude-from=[gitdir info exclude]\"\n-\t}\n-\tset user_exclude [get_config core.excludesfile]\n-\tif {$user_exclude ne {} && [file readable $user_exclude]} {\n-\t\tlappend ls_others \"--exclude-from=$user_exclude\"\n-\t}\n+\tset ls_others [list --exclude-standard]\n \n \tset buf_rdi {}\n \tset buf_rdf {}\n-- \n1.7.3.2\n"},{"id":"156799","messageId":"AANLkTinTemOzkg8h=eHfqucZK6=yL2WymVW7ff1G9+ee@mail.gmail.com","threadId":"25770","inReplyTo":"8739qxglfb.fsf@fox.patthoyts.tk","subject":"Re: [PATCH] git-gui: use --exclude-standard to check for untracked files","fromName":"Stefan Näwe","fromEmail":"stefan.naewe@googlemail.com","sentAt":"2010-11-29T13:33:39Z","receivedAt":"2010-11-29T13:33:39Z","isPatch":true,"sender":{"key":"stefan.naewe@gmail.com","avatar":"https://avatars.githubusercontent.com/u/4468?v=4"},"body":"(Sorry for the late answer, I was away...)\n\n2010/11/19 Pat Thoyts <patthoyts@users.sourceforge.net>:\n> Stefan Naewe <stefan.naewe@googlemail.com> writes:\n>\n>>This fixes git gui failing to display untracked files if\n>>core.excludesfile is set to '~/.gitexcludes'.\n>>\n>>Signed-off-by: Stefan Naewe <stefan.naewe@googlemail.com>\n>>---\n>> git-gui/git-gui.sh |    9 +--------\n>> 1 files changed, 1 insertions(+), 8 deletions(-)\n> [..]\n> Using --exclude-standard is a good plan. However, as far as I can tell\n> this option was added for git 1.6.3. git-gui currently supports 1.5.0 or\n> above so rather than delete the old lines we can wrap them in a version\n> check and use --exclude-standard if we have it.\n>\n> Also - I assume that the problem with core.excludesfile being set as you\n> describe is that ~ is expanded by the shell. Here we are working in tcl\n> which will take the literal string. Adding [file normalize] to the\n> exclude value will expand the ~ to the users HOME path for us.\n>\n> The following should be cover everything and works for me:\n>\n>\n> From 55e5893c08a52624846dbd9b61dcbccc6bbc5e12 Mon Sep 17 00:00:00 2001\n> From: Stefan Naewe <stefan.naewe@googlemail.com>\n> Date: Fri, 19 Nov 2010 19:28:25 +0000\n> Subject: [PATCH] git-gui: use --exclude-standard to check for untracked files\n>\n> This fixes git-gui failing to display untracked files that are listed\n> if core.excludefiles is set to ~/.gitexcludes\n>\n> [PT: added expansion of core.excludesfile value by tcl]\n>\n> Signed-off-by: Stefan Naewe <stefan.naewe@googlemail.com>\n> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>\n> ---\n>  git-gui.sh |   18 +++++++++++-------\n>  1 files changed, 11 insertions(+), 7 deletions(-)\n>\n> diff --git a/git-gui.sh b/git-gui.sh\n> index d3acf0d..8c696c2 100755\n> --- a/git-gui.sh\n> +++ b/git-gui.sh\n> @@ -1448,13 +1448,17 @@ proc rescan_stage2 {fd after} {\n>                close $fd\n>        }\n>\n> -       set ls_others [list --exclude-per-directory=.gitignore]\n> -       if {[have_info_exclude]} {\n> -               lappend ls_others \"--exclude-from=[gitdir info exclude]\"\n> -       }\n> -       set user_exclude [get_config core.excludesfile]\n> -       if {$user_exclude ne {} && [file readable $user_exclude]} {\n> -               lappend ls_others \"--exclude-from=$user_exclude\"\n> +       if {0 && [package vsatisfies $::_git_version 1.6.3]} {\n> +               set ls_others [list --exclude-standard]\n> +       } else {\n> +               set ls_others [list --exclude-per-directory=.gitignore]\n> +               if {[have_info_exclude]} {\n> +                       lappend ls_others \"--exclude-from=[gitdir info exclude]\"\n> +               }\n> +               set user_exclude [get_config core.excludesfile]\n> +               if {$user_exclude ne {} && [file readable $user_exclude]} {\n> +                       lappend ls_others \"--exclude-from=[file normalize $user_exclude]\"\n> +               }\n>        }\n>\n>        set buf_rdi {}\n> --\n> 1.7.3.1.msysgit.0\n\nYes, works for me (on 1.7.3.2)\n\nThanks,\n  Stefan\n-- \nStefan Naewe                      stefan dot naewe at gmail dot com\nDon't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html\nPlain text mails only, please      http://www.expita.com/nomime.html\n"}]}