Re: [PATCH 9/9] Add git-check-ignores

2012-09-10 Thread Adam Spiers
On Tue, Sep 04, 2012 at 08:06:12PM +0700, Nguyen Thai Ngoc Duy wrote: On Sun, Sep 2, 2012 at 7:12 AM, Adam Spiers g...@adamspiers.org wrote: --- a/builtin/add.c +++ b/builtin/add.c @@ -273,7 +273,7 @@ static int add_files(struct dir_struct *dir, int flags) fprintf(stderr,

Re: [PATCH 9/9] Add git-check-ignores

2012-09-10 Thread Adam Spiers
On Wed, Sep 05, 2012 at 05:25:25PM +0700, Nguyen Thai Ngoc Duy wrote: On Wed, Sep 5, 2012 at 12:26 AM, Junio C Hamano gits...@pobox.com wrote: Nguyen Thai Ngoc Duy pclo...@gmail.com writes: +static void output_exclude(const char *path, struct exclude *exclude) +{ + char *type =

Re: [PATCH 9/9] Add git-check-ignores

2012-09-10 Thread Nguyen Thai Ngoc Duy
On Mon, Sep 10, 2012 at 6:09 PM, Adam Spiers g...@adamspiers.org wrote: fprintf(stderr, %s\n, dir-ignored[i]-name); - fprintf(stderr, _(Use -f if you really want to add them.\n)); + fprintf(stderr, _(Use -f if you really want to add

Re: [PATCH 9/9] Add git-check-ignores

2012-09-10 Thread Junio C Hamano
Adam Spiers g...@adamspiers.org writes: Administrivia. Please never deflect direct responses to you with Mail-Followup-To header. I told my mailer to follow-up so that I could give you advice in response, while adding others in the discussion to Cc so that they do not have to repeat what I

Re: [PATCH 9/9] Add git-check-ignores

2012-09-05 Thread Nguyen Thai Ngoc Duy
On Wed, Sep 5, 2012 at 12:26 AM, Junio C Hamano gits...@pobox.com wrote: Nguyen Thai Ngoc Duy pclo...@gmail.com writes: +static void output_exclude(const char *path, struct exclude *exclude) +{ + char *type = exclude-to_exclude ? excluded : included; + char *bang =

Re: [PATCH 9/9] Add git-check-ignores

2012-09-04 Thread Junio C Hamano
Nguyen Thai Ngoc Duy pclo...@gmail.com writes: +static void output_exclude(const char *path, struct exclude *exclude) +{ + char *type = exclude-to_exclude ? excluded : included; + char *bang = exclude-to_exclude ? : !; + char *dir = (exclude-flags EXC_FLAG_MUSTBEDIR) ? /

Re: [PATCH 9/9] Add git-check-ignores

2012-09-02 Thread Adam Spiers
Hi there, Firstly, thanks for the quick feedback! On Sun, Sep 2, 2012 at 11:41 AM, Nguyen Thai Ngoc Duy pclo...@gmail.com wrote: On Sun, Sep 2, 2012 at 7:12 AM, Adam Spiers g...@adamspiers.org wrote: This works in a similar manner to git-check-attr. Some code was reused from add.c by

Re: [PATCH 9/9] Add git-check-ignores

2012-09-02 Thread Junio C Hamano
Adam Spiers g...@adamspiers.org writes: +SYNOPSIS + +[verse] +'git check-ignore' pathname... +'git check-ignore' --stdin [-z] list-of-paths Also --quiet option, where check-ignore returns 0 if the given path is ignored, 1 otherwise? I agree that multiple paths are problematic.

Re: [PATCH 9/9] Add git-check-ignores

2012-09-02 Thread Junio C Hamano
Adam Spiers g...@adamspiers.org writes: +OPTIONS +--- +--stdin:: + Read file names from stdin instead of from the command-line. + +-z:: + Only meaningful with `--stdin`; paths are separated with a + NUL character instead of a linefeed character. On input, or on output, or

Re: [PATCH 9/9] Add git-check-ignores

2012-09-02 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Let's step back a bit and think what this command is about. What is the reason why the user wants to run check-ignore $path in the first place? I think there are two (or three, depending on how you count). (1) You have one (or more) paths at hand.

Re: [PATCH 9/9] Add git-check-ignores

2012-09-02 Thread Nguyen Thai Ngoc Duy
On Sun, Sep 2, 2012 at 9:50 PM, Adam Spiers g...@adamspiers.org wrote: I'm no expert on .gitattributes and check-attr, but AFAICS, all the opportunities to share code in the plumbing and front-end seem to be taken already, e.g. the directory traversal and path handling. The CLI argument

[PATCH 9/9] Add git-check-ignores

2012-09-01 Thread Adam Spiers
This works in a similar manner to git-check-attr. Some code was reused from add.c by refactoring out into pathspec.c. Thanks to Jeff King and Junio C Hamano for the idea: http://thread.gmane.org/gmane.comp.version-control.git/108671/focus=108815 Signed-off-by: Adam Spiers g...@adamspiers.org