git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Stefan Näwe" <stefan.naewe@googlemail.com>
To: Pat Thoyts <patthoyts@users.sourceforge.net>
Cc: gitster@pobox.com, git@vger.kernel.org
Subject: Re: [PATCH] git-gui: use --exclude-standard to check for untracked files
Date: Mon, 29 Nov 2010 14:33:39 +0100	[thread overview]
Message-ID: <AANLkTinTemOzkg8h=eHfqucZK6=yL2WymVW7ff1G9+ee@mail.gmail.com> (raw)
In-Reply-To: <8739qxglfb.fsf@fox.patthoyts.tk>

(Sorry for the late answer, I was away...)

2010/11/19 Pat Thoyts <patthoyts@users.sourceforge.net>:
> Stefan Naewe <stefan.naewe@googlemail.com> writes:
>
>>This fixes git gui failing to display untracked files if
>>core.excludesfile is set to '~/.gitexcludes'.
>>
>>Signed-off-by: Stefan Naewe <stefan.naewe@googlemail.com>
>>---
>> git-gui/git-gui.sh |    9 +--------
>> 1 files changed, 1 insertions(+), 8 deletions(-)
> [..]
> Using --exclude-standard is a good plan. However, as far as I can tell
> this option was added for git 1.6.3. git-gui currently supports 1.5.0 or
> above so rather than delete the old lines we can wrap them in a version
> check and use --exclude-standard if we have it.
>
> Also - I assume that the problem with core.excludesfile being set as you
> describe is that ~ is expanded by the shell. Here we are working in tcl
> which will take the literal string. Adding [file normalize] to the
> exclude value will expand the ~ to the users HOME path for us.
>
> The following should be cover everything and works for me:
>
>
> From 55e5893c08a52624846dbd9b61dcbccc6bbc5e12 Mon Sep 17 00:00:00 2001
> From: Stefan Naewe <stefan.naewe@googlemail.com>
> Date: Fri, 19 Nov 2010 19:28:25 +0000
> Subject: [PATCH] git-gui: use --exclude-standard to check for untracked files
>
> This fixes git-gui failing to display untracked files that are listed
> if core.excludefiles is set to ~/.gitexcludes
>
> [PT: added expansion of core.excludesfile value by tcl]
>
> Signed-off-by: Stefan Naewe <stefan.naewe@googlemail.com>
> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
> ---
>  git-gui.sh |   18 +++++++++++-------
>  1 files changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/git-gui.sh b/git-gui.sh
> index d3acf0d..8c696c2 100755
> --- a/git-gui.sh
> +++ b/git-gui.sh
> @@ -1448,13 +1448,17 @@ proc rescan_stage2 {fd after} {
>                close $fd
>        }
>
> -       set ls_others [list --exclude-per-directory=.gitignore]
> -       if {[have_info_exclude]} {
> -               lappend ls_others "--exclude-from=[gitdir info exclude]"
> -       }
> -       set user_exclude [get_config core.excludesfile]
> -       if {$user_exclude ne {} && [file readable $user_exclude]} {
> -               lappend ls_others "--exclude-from=$user_exclude"
> +       if {0 && [package vsatisfies $::_git_version 1.6.3]} {
> +               set ls_others [list --exclude-standard]
> +       } else {
> +               set ls_others [list --exclude-per-directory=.gitignore]
> +               if {[have_info_exclude]} {
> +                       lappend ls_others "--exclude-from=[gitdir info exclude]"
> +               }
> +               set user_exclude [get_config core.excludesfile]
> +               if {$user_exclude ne {} && [file readable $user_exclude]} {
> +                       lappend ls_others "--exclude-from=[file normalize $user_exclude]"
> +               }
>        }
>
>        set buf_rdi {}
> --
> 1.7.3.1.msysgit.0

Yes, works for me (on 1.7.3.2)

Thanks,
  Stefan
-- 
Stefan Naewe                      stefan dot naewe at gmail dot com
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

      parent reply	other threads:[~2010-11-29 13:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-17 15:13 [PATCH] git-gui: use --exclude-standard to check for untracked files Stefan Naewe
     [not found] ` <8739qxglfb.fsf@fox.patthoyts.tk>
2010-11-29 13:33   ` Stefan Näwe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTinTemOzkg8h=eHfqucZK6=yL2WymVW7ff1G9+ee@mail.gmail.com' \
    --to=stefan.naewe@googlemail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=patthoyts@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).