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

2012-09-10 Thread Junio C Hamano
Adam Spiers 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 said, but your "Mail

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 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 them,

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 wrote: > > Nguyen Thai Ngoc Duy writes: > > > >>> +static void output_exclude(const char *path, struct exclude *exclude) > >>> +{ > >>> + char *type = exclude->to_exclude

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 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, _(ignore_er

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 wrote: > Nguyen Thai Ngoc Duy writes: > >>> +static void output_exclude(const char *path, struct exclude *exclude) >>> +{ >>> + char *type = exclude->to_exclude ? "excluded" : "included"; >>> + char *bang = exclude->to_exclude ? "" : "!"

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

2012-09-04 Thread Junio C Hamano
Nguyen Thai Ngoc Duy 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-04 Thread Nguyen Thai Ngoc Duy
On Sun, Sep 2, 2012 at 7:12 AM, Adam Spiers 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, _(ignore_error)); > for (i = 0; i < dir->ignored_nr; i++) >

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 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 parsing is necessaril

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

2012-09-02 Thread Junio C Hamano
Junio C Hamano 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. You want

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

2012-09-02 Thread Junio C Hamano
Adam Spiers 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 both? The

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

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

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 wrote: > On Sun, Sep 2, 2012 at 7:12 AM, Adam Spiers wrote: >> This works in a similar manner to git-check-attr. Some code >> was reused from add.c by refactoring out into pathspec.c. > > Th

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

2012-09-02 Thread Nguyen Thai Ngoc Duy
On Sun, Sep 2, 2012 at 7:12 AM, Adam Spiers wrote: > This works in a similar manner to git-check-attr. Some code > was reused from add.c by refactoring out into pathspec.c. Thanks, comments from a quick glance. First of all, can we make it work (or share code) with .gitattributes? We may need to

[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 --- .gitignore