Re: [git-users] List of ignore configuration file

2019-01-24 Thread Konstantin Khomoutov
On Wed, Jan 23, 2019 at 10:15:59AM -0800, cl.robitai...@gmail.com wrote:

> Well, the first point to mention is that anyone writing help, man page and 
> information must not forget that the vast majority of readers are reading 
> such information because they do not know. This is obvious but the main 
> point is to not take for granted that they have a deep knowledge, 
> particularly when a concept is a bit "strange"...
[...]
> 2 - For the git-check-ignore. here are my suggestions
[...]

Forwarded this your message to the main Git list [1].

1.  https://public-inbox.org/git/20190123192151.uwwbkkoib7zqhoip@tigra/T/#u

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] List of ignore configuration file

2019-01-23 Thread cl . robitaille
Well, the first point to mention is that anyone writing help, man page and 
information must not forget that the vast majority of readers are reading 
such information because they do not know. This is obvious but the main 
point is to not take for granted that they have a deep knowledge, 
particularly when a concept is a bit "strange"...

Now, I understand that git is, normally, for developers, which are 
typically more knowledgeable, but still

And I agree it helps to have real user inputs, so I will provide many. I do 
not expect all be accepted but this is Ok.

So, here it is

1 - Ideally, the man page should be following "the standard" format. I am 
not sure if one exists but since the vast majority of the man pages are 
using the same layout I presume that there is some form of soft standard. 
Here, obviously, my point is about listing all of the files and their 
location at the end of the page (which does not preclude to mention then 
elsewhere in the text if desire).

2 - For the git-check-ignore. here are my suggestions

DESCRIPTION
   For each pathname given via the command-line or from a file via 
--stdin, check whether the file* / directory*  is excluded by .gitignore 
(or other input files to the
   exclude mechanism) and output the path if it is excluded.

   By default, tracked files * and directories *are not shown at all 
since they are not subject to exclude rules; but see ‘--no-index’. *In the 
case of a directory, any *
*   tracked file or directory below it will cause the directory not to 
be shown.*

3 - Again in git-check-ignore.
 
Actually, here, I think the description of --no-index is wrong. At least in 
my case, which was that a directory WAS ignored by git add because a file 
under it was already tracked. The man page description is only talking 
about the opposite case where git add is not ignoring the pathname. I 
wanted to provide a suggestion here but I fail to understand the use case 
described by the man page. In fact, I am not even sure it is correct. git 
add appears to honor the ignore instructions despite having already tracked 
objects. May be the use case is when the pathname is BELOW something 
already tracked??

4 - git check-ignore should be augmented to have an option of simply 
listing all of the ignore files, may be even allowing to dump their 
content. The latter may be too much



On Tuesday, January 22, 2019 at 5:37:11 PM UTC-5, Philip Oakley wrote:
>
> oops sent from wrong email identity.. 
>
> On 22/01/2019 22:35, Philip Oakley wrote: 
> > On 22/01/2019 21:20, Claude Robitaille wrote: 
> >> Thanks this help. 
> >> 
> >> I did read the man page, but I am used at seeing the files and 
> >> locations at the end of the man page the section FILES. My bad to 
> >> skiping right to the end of the man page. See dnsmasq as an example. 
> >> 
> >> Yes TL;DR. :-( I skip too quickly on --no-index. But now I 
> >> understand that it makes check-ignore to "mimic" add (even if 
> >> mimic was not the intent) 
> >> 
> >> But, the description is talking about file and tracked files. It is 
> >> not obvious for an occasional user to correlate that with "my dir is 
> >> not checked because something under it is indeed tracked" . Bomttom 
> >> line, what I am saying is that dir and file are slightly different in 
> >> the context here and yes my mental model was wrong. 
> >> 
> ---> 
> > Extra points for you will be on order if you can suggest some better 
> > wording for manual pages to help others patch that misunderstanding. 
> > The same would apply to a contribution for the git-scm 'book'. 
> > 
> > It is a help to the devs to have some real user input... 
> > 
> > 
> > Philip 
> > 
> >> 
> >> 
> >> Le mar. 22 janv. 2019 à 15:09, Konstantin Khomoutov   
> >> > a écrit : 
> >> 
> >> On Tue, Jan 22, 2019 at 10:55:50AM -0800, cl.rob...@gmail.com 
>  
> >>  wrote: 
> >> 
> >> > Is there a way to list ALL of the ignore files that a given git 
> >> uses? 
> >> 
> >> Yes. This list is documented in the gitignore(5) manual page. 
> >> Run `git help ignore` to read it. 
> >> 
> >> > There are tons of files and locations that git uses and Googling 
> >> only 
> >> > reports a partial list.. in my case, I had, but forgotten, 
> >> both 
> >> > ~/.gitconfig AND ~/.config/git/ignore. The later was never 
> >> mentioned 
> >> > anywhere on Google but was the culprit of my issue. 
> >> 
> >> Your general problem is a wrong approach: instead of googling, you 
> >> should better have spent your time contemplating the first two 
> >> paragraphs of the manual page mentioned above. 
> >> 
> >> > Ok, I know, git check-ignore be used. But not in my case!!! Here 
> >> is an 
> >> > example 
> >> > 
> >> > git add lib 
> >> > The following paths are ignored by one of your .gitignore files: 
> >> > lib 
> >> 

Re: [git-users] List of ignore configuration file

2019-01-22 Thread Philip Oakley

oops sent from wrong email identity..

On 22/01/2019 22:35, Philip Oakley wrote:

On 22/01/2019 21:20, Claude Robitaille wrote:

Thanks this help.

I did read the man page, but I am used at seeing the files and 
locations at the end of the man page the section FILES. My bad to 
skiping right to the end of the man page. See dnsmasq as an example.


Yes TL;DR. :-( I skip too quickly on --no-index. But now I 
understand that it makes check-ignore to "mimic" add (even if 
mimic was not the intent)


But, the description is talking about file and tracked files. It is 
not obvious for an occasional user to correlate that with "my dir is 
not checked because something under it is indeed tracked" . Bomttom 
line, what I am saying is that dir and file are slightly different in 
the context here and yes my mental model was wrong.



--->
Extra points for you will be on order if you can suggest some better 
wording for manual pages to help others patch that misunderstanding. 
The same would apply to a contribution for the git-scm 'book'.


It is a help to the devs to have some real user input...


Philip




Le mar. 22 janv. 2019 à 15:09, Konstantin Khomoutov > a écrit :


    On Tue, Jan 22, 2019 at 10:55:50AM -0800, cl.robitai...@gmail.com
     wrote:

    > Is there a way to list ALL of the ignore files that a given git
    uses?

    Yes. This list is documented in the gitignore(5) manual page.
    Run `git help ignore` to read it.

    > There are tons of files and locations that git uses and Googling
    only
    > reports a partial list.. in my case, I had, but forgotten, 
both

    > ~/.gitconfig AND ~/.config/git/ignore. The later was never
    mentioned
    > anywhere on Google but was the culprit of my issue.

    Your general problem is a wrong approach: instead of googling, you
    should better have spent your time contemplating the first two
    paragraphs of the manual page mentioned above.

    > Ok, I know, git check-ignore be used. But not in my case!!! Here
    is an
    > example
    >
    > git add lib
    > The following paths are ignored by one of your .gitignore files:
    > lib
    > Use -f if you really want to add them.
    >
    >
    > git check-ignore lib
    > NO OUTPUT
    >
    >
    > git check-ignore -v -n lib
    > :: lib
    >
    >
    > The 2 git check-ignore clearly say that lib should not be
    ignored (the NO
    > OUTPUT is me writing) while git add ignores it. So, somehow, git
    > check-ignore is misleading. Some files under lib are already
    under control;
    > I probably added lib/ in the ignore long time ago (so that I
    forgot) and
    > MAY be the reason why git check-ignore fails reporting the same
    behaviour
    > as git add. Just a guess though...

    No, you just have a mental model about how `git check-ignore` works
    different from how it's actually implemented.

    Again, reading the manual page of that command should have helped.
    In the intro part of that manual page, we read:

    | By default, tracked files are not shown at all since they are not
    | subject to exclude rules; but see ‘--no-index’.

    So, the reason Git says you have 'lib' ignored when you attempt to
    `git add` it is because you have this directory ignored _and_ 
have it
    included in the commit HEAD points at (what you currently have 
checked

    out).

    To demonstrate:

      ~$ cd ~/tmp
      tmp$ mkdir zzz
      tmp$ cd zzz
      zzz$ git init .
      Initialized empty Git repository in /home/kostix/tmp/zzz/.git/

      zzz$ touch aaa
      zzz$ git add aaa
      zzz$ git commit aaa
      [master (root-commit) f98e522] boo
       1 file changed, 0 insertions(+), 0 deletions(-)
       create mode 100644 aaa

      zzz$ mkdir lib
      zzz$ touch lib/bbb
      zzz$ git add lib/bbb
      zzz$ git commit
      [master 2a63dbe] trrr
       1 file changed, 0 insertions(+), 0 deletions(-)
       create mode 100644 lib/bbb

      zzz$ echo 'lib/' >.gitignore

      zzz$ git add lib
      The following paths are ignored by one of your .gitignore files:
      lib
      Use -f if you really want to add them.

      zzz$ git check-ignore -v lib

      zzz$ git check-ignore -v -n lib
      ::      lib

    So, that's precisely what you see.

    Now let's add "--no-index" as suggested by the manual page - to 
ignore

    "lib" even if we have it tracked:

      zzz$ git check-ignore -v --no-index lib
      .gitignore:1:lib/       lib

    It works.


    TL;DR

    1) You have your "lib" directory tracked by Git.
       This means the currently checked out commit have at least a 
single

       file from that directory (or deeper) included.

    2) You have your "lib" directory ignored.

    The crux here is that the "ignoring" mechanics have nothing to
    with what
    files Git actually tracks (as part of commits). The behaviour of the
    `git check-ignore` may arguably seem weird but it's 

Re: [git-users] List of ignore configuration file

2019-01-22 Thread Claude Robitaille
Thanks this help.

I did read the man page, but I am used at seeing the files and locations at
the end of the man page the section FILES. My bad to skiping right to the
end of the man page. See dnsmasq as an example.

Yes TL;DR. :-( I skip too quickly on --no-index. But now I understand
that it makes check-ignore to "mimic" add (even if mimic was not the
intent)

But, the description is talking about file and tracked files. It is not
obvious for an occasional user to correlate that with "my dir is not
checked because something under it is indeed tracked" . Bomttom line, what
I am saying is that dir and file are slightly different in the context here
and yes my mental model was wrong.



Le mar. 22 janv. 2019 à 15:09, Konstantin Khomoutov  a
écrit :

> On Tue, Jan 22, 2019 at 10:55:50AM -0800, cl.robitai...@gmail.com wrote:
>
> > Is there a way to list ALL of the ignore files that a given git uses?
>
> Yes. This list is documented in the gitignore(5) manual page.
> Run `git help ignore` to read it.
>
> > There are tons of files and locations that git uses and Googling only
> > reports a partial list.. in my case, I had, but forgotten, both
> > ~/.gitconfig AND ~/.config/git/ignore. The later was never mentioned
> > anywhere on Google but was the culprit of my issue.
>
> Your general problem is a wrong approach: instead of googling, you
> should better have spent your time contemplating the first two
> paragraphs of the manual page mentioned above.
>
> > Ok, I know, git check-ignore be used. But not in my case!!! Here is an
> > example
> >
> > git add lib
> > The following paths are ignored by one of your .gitignore files:
> > lib
> > Use -f if you really want to add them.
> >
> >
> > git check-ignore lib
> > NO OUTPUT
> >
> >
> > git check-ignore -v -n lib
> > :: lib
> >
> >
> > The 2 git check-ignore clearly say that lib should not be ignored (the
> NO
> > OUTPUT is me writing) while git add ignores it. So, somehow, git
> > check-ignore is misleading. Some files under lib are already under
> control;
> > I probably added lib/ in the ignore long time ago (so that I forgot) and
> > MAY be the reason why git check-ignore fails reporting the same
> behaviour
> > as git add. Just a guess though...
>
> No, you just have a mental model about how `git check-ignore` works
> different from how it's actually implemented.
>
> Again, reading the manual page of that command should have helped.
> In the intro part of that manual page, we read:
>
> | By default, tracked files are not shown at all since they are not
> | subject to exclude rules; but see ‘--no-index’.
>
> So, the reason Git says you have 'lib' ignored when you attempt to
> `git add` it is because you have this directory ignored _and_ have it
> included in the commit HEAD points at (what you currently have checked
> out).
>
> To demonstrate:
>
>   ~$ cd ~/tmp
>   tmp$ mkdir zzz
>   tmp$ cd zzz
>   zzz$ git init .
>   Initialized empty Git repository in /home/kostix/tmp/zzz/.git/
>
>   zzz$ touch aaa
>   zzz$ git add aaa
>   zzz$ git commit aaa
>   [master (root-commit) f98e522] boo
>1 file changed, 0 insertions(+), 0 deletions(-)
>create mode 100644 aaa
>
>   zzz$ mkdir lib
>   zzz$ touch lib/bbb
>   zzz$ git add lib/bbb
>   zzz$ git commit
>   [master 2a63dbe] trrr
>1 file changed, 0 insertions(+), 0 deletions(-)
>create mode 100644 lib/bbb
>
>   zzz$ echo 'lib/' >.gitignore
>
>   zzz$ git add lib
>   The following paths are ignored by one of your .gitignore files:
>   lib
>   Use -f if you really want to add them.
>
>   zzz$ git check-ignore -v lib
>
>   zzz$ git check-ignore -v -n lib
>   ::  lib
>
> So, that's precisely what you see.
>
> Now let's add "--no-index" as suggested by the manual page - to ignore
> "lib" even if we have it tracked:
>
>   zzz$ git check-ignore -v --no-index lib
>   .gitignore:1:lib/   lib
>
> It works.
>
>
> TL;DR
>
> 1) You have your "lib" directory tracked by Git.
>This means the currently checked out commit have at least a single
>file from that directory (or deeper) included.
>
> 2) You have your "lib" directory ignored.
>
> The crux here is that the "ignoring" mechanics have nothing to with what
> files Git actually tracks (as part of commits). The behaviour of the
> `git check-ignore` may arguably seem weird but it's documented
> nonetheless.
>
> Hope this helps.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to git-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] List of ignore configuration file

2019-01-22 Thread Konstantin Khomoutov
On Tue, Jan 22, 2019 at 10:55:50AM -0800, cl.robitai...@gmail.com wrote:

> Is there a way to list ALL of the ignore files that a given git uses?

Yes. This list is documented in the gitignore(5) manual page.
Run `git help ignore` to read it.

> There are tons of files and locations that git uses and Googling only 
> reports a partial list.. in my case, I had, but forgotten, both 
> ~/.gitconfig AND ~/.config/git/ignore. The later was never mentioned 
> anywhere on Google but was the culprit of my issue.

Your general problem is a wrong approach: instead of googling, you
should better have spent your time contemplating the first two
paragraphs of the manual page mentioned above.

> Ok, I know, git check-ignore be used. But not in my case!!! Here is an 
> example
> 
> git add lib
> The following paths are ignored by one of your .gitignore files:
> lib
> Use -f if you really want to add them.
> 
> 
> git check-ignore lib
> NO OUTPUT
> 
> 
> git check-ignore -v -n lib
> :: lib
> 
> 
> The 2 git check-ignore clearly say that lib should not be ignored (the NO 
> OUTPUT is me writing) while git add ignores it. So, somehow, git 
> check-ignore is misleading. Some files under lib are already under control; 
> I probably added lib/ in the ignore long time ago (so that I forgot) and 
> MAY be the reason why git check-ignore fails reporting the same behaviour 
> as git add. Just a guess though...

No, you just have a mental model about how `git check-ignore` works
different from how it's actually implemented.

Again, reading the manual page of that command should have helped.
In the intro part of that manual page, we read:

| By default, tracked files are not shown at all since they are not
| subject to exclude rules; but see ‘--no-index’.

So, the reason Git says you have 'lib' ignored when you attempt to
`git add` it is because you have this directory ignored _and_ have it
included in the commit HEAD points at (what you currently have checked
out).

To demonstrate:

  ~$ cd ~/tmp
  tmp$ mkdir zzz
  tmp$ cd zzz
  zzz$ git init .
  Initialized empty Git repository in /home/kostix/tmp/zzz/.git/
  
  zzz$ touch aaa
  zzz$ git add aaa
  zzz$ git commit aaa
  [master (root-commit) f98e522] boo
   1 file changed, 0 insertions(+), 0 deletions(-)
   create mode 100644 aaa
  
  zzz$ mkdir lib
  zzz$ touch lib/bbb
  zzz$ git add lib/bbb
  zzz$ git commit
  [master 2a63dbe] trrr
   1 file changed, 0 insertions(+), 0 deletions(-)
   create mode 100644 lib/bbb
  
  zzz$ echo 'lib/' >.gitignore
  
  zzz$ git add lib
  The following paths are ignored by one of your .gitignore files:
  lib
  Use -f if you really want to add them.
  
  zzz$ git check-ignore -v lib
  
  zzz$ git check-ignore -v -n lib
  ::  lib

So, that's precisely what you see.

Now let's add "--no-index" as suggested by the manual page - to ignore
"lib" even if we have it tracked:

  zzz$ git check-ignore -v --no-index lib
  .gitignore:1:lib/   lib

It works.


TL;DR

1) You have your "lib" directory tracked by Git.
   This means the currently checked out commit have at least a single
   file from that directory (or deeper) included.

2) You have your "lib" directory ignored.

The crux here is that the "ignoring" mechanics have nothing to with what
files Git actually tracks (as part of commits). The behaviour of the
`git check-ignore` may arguably seem weird but it's documented
nonetheless.

Hope this helps.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] List of ignore configuration file

2019-01-22 Thread cl . robitaille
Is there a way to list ALL of the ignore files that a given git uses?

There are tons of files and locations that git uses and Googling only 
reports a partial list.. in my case, I had, but forgotten, both 
~/.gitconfig AND ~/.config/git/ignore. The later was never mentioned 
anywhere on Google but was the culprit of my issue.

Ok, I know, git check-ignore be used. But not in my case!!! Here is an 
example

git add lib
The following paths are ignored by one of your .gitignore files:
lib
Use -f if you really want to add them.


git check-ignore lib
NO OUTPUT


git check-ignore -v -n lib
:: lib


The 2 git check-ignore clearly say that lib should not be ignored (the NO 
OUTPUT is me writing) while git add ignores it. So, somehow, git 
check-ignore is misleading. Some files under lib are already under control; 
I probably added lib/ in the ignore long time ago (so that I forgot) and 
MAY be the reason why git check-ignore fails reporting the same behaviour 
as git add. Just a guess though...

Anyway, the ability to explicitly list all of the source of ignore files 
would be a nice thing to have. Ideally, you want the list to be in the same 
order as what git is using.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.