# [PATCH] Documentation/git-update-index.txt: Remove obsolete note

5 messages from 2011-03-30 to 2011-04-02. Participants: Jakob Pfender, Nguyen Thai Ngoc Duy, Junio C Hamano.
Thread: https://gitlist.dev/t/26927

## Jakob Pfender, 2011-03-30 13:01

Subject: [PATCH] Documentation/git-update-index.txt: Remove obsolete note
Message-ID: <4D9329C5.3060809@elegosoft.com>
URL: https://gitlist.dev/e/4D9329C5.3060809%40elegosoft.com

```
8dcf39 (Prevent bogus paths from being added to the index) introduced a
check for files beginning with '.', preventing path names such as
`./file`, `dir/./file` or `dir/../file` from being added. This was
reflected in the man page.

d089eba (setup: sanitize absolute and funny paths in get_pathspec())
removed this check without reflecting the change in the man page.

Signed-off-by: Jakob Pfender <jpfender@elegosoft.com>
---
  Documentation/git-update-index.txt |    6 ++----
  1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/Documentation/git-update-index.txt 
b/Documentation/git-update-index.txt
index 1ca56c8..f0dcd1f 100644
--- a/Documentation/git-update-index.txt
+++ b/Documentation/git-update-index.txt
@@ -152,10 +152,8 @@ you will need to handle the situation manually.

  <file>::
  	Files to act on.
-	Note that files beginning with '.' are discarded. This includes
-	`./file` and `dir/./file`. If you don't want this, then use
-	cleaner names.
-	The same applies to directories ending '/' and paths with '//'
+	Note that directories ending in '/' and paths with '//' are
+	discarded.

  Using --refresh
  ---------------
-- 
1.7.0.4

```

## Nguyen Thai Ngoc Duy, 2011-03-31 12:15

Subject: Re: [PATCH] Documentation/git-update-index.txt: Remove obsolete note
Message-ID: <AANLkTik3nEE2mtpRVwuQxfoNZd8Ejpgc=T=GS_jEpXsB@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTik3nEE2mtpRVwuQxfoNZd8Ejpgc%3DT%3DGS_jEpXsB%40mail.gmail.com
In-Reply-To: <4D9329C5.3060809@elegosoft.com>

```
On Wed, Mar 30, 2011 at 8:01 PM, Jakob Pfender <jpfender@elegosoft.com> wrote:
> 8dcf39 (Prevent bogus paths from being added to the index) introduced a
> check for files beginning with '.', preventing path names such as
> `./file`, `dir/./file` or `dir/../file` from being added. This was
> reflected in the man page.
>
> d089eba (setup: sanitize absolute and funny paths in get_pathspec())
> removed this check without reflecting the change in the man page.

Sounds good.

>  <file>::
>        Files to act on.
> -       Note that files beginning with '.' are discarded. This includes
> -       `./file` and `dir/./file`. If you don't want this, then use
> -       cleaner names.
> -       The same applies to directories ending '/' and paths with '//'
> +       Note that directories ending in '/' and paths with '//' are
> +       discarded.

Do you mean the slashes or the directories are discarded? Directories
are not, I believe.
-- 
Duy

```

## Jakob Pfender, 2011-03-31 15:18

Subject: Re: [PATCH] Documentation/git-update-index.txt: Remove obsolete note
Message-ID: <4D949B53.80801@elegosoft.com>
URL: https://gitlist.dev/e/4D949B53.80801%40elegosoft.com
In-Reply-To: <AANLkTik3nEE2mtpRVwuQxfoNZd8Ejpgc=T=GS_jEpXsB@mail.gmail.com>

```
On 03/31/2011 02:15 PM, Nguyen Thai Ngoc Duy wrote:
 > On Wed, Mar 30, 2011 at 8:01 PM, Jakob 
Pfender<jpfender@elegosoft.com>  wrote:
 >> 8dcf39 (Prevent bogus paths from being added to the index) introduced a
 >> check for files beginning with '.', preventing path names such as
 >> `./file`, `dir/./file` or `dir/../file` from being added. This was
 >> reflected in the man page.
 >>
 >> d089eba (setup: sanitize absolute and funny paths in get_pathspec())
 >> removed this check without reflecting the change in the man page.
 >
 > Sounds good.
 >
 >>   <file>::
 >>         Files to act on.
 >> -       Note that files beginning with '.' are discarded. This includes
 >> -       `./file` and `dir/./file`. If you don't want this, then use
 >> -       cleaner names.
 >> -       The same applies to directories ending '/' and paths with '//'
 >> +       Note that directories ending in '/' and paths with '//' are
 >> +       discarded.
 >
 > Do you mean the slashes or the directories are discarded? Directories
 > are not, I believe.

Since we're talking about update-index, yes, directories are actually
discarded, as update-index only accepts files. Directories can be added
via git-add as git-add just passes the single files in the directory to
update-index.

```

## Junio C Hamano, 2011-03-31 21:41

Subject: Re: [PATCH] Documentation/git-update-index.txt: Remove obsolete note
Message-ID: <7v7hbfj7d6.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v7hbfj7d6.fsf%40alter.siamese.dyndns.org
In-Reply-To: <AANLkTik3nEE2mtpRVwuQxfoNZd8Ejpgc=T=GS_jEpXsB@mail.gmail.com>

```
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:

> On Wed, Mar 30, 2011 at 8:01 PM, Jakob Pfender <jpfender@elegosoft.com> wrote:
>> 8dcf39 (Prevent bogus paths from being added to the index) introduced a
>> check for files beginning with '.', preventing path names such as
>> `./file`, `dir/./file` or `dir/../file` from being added. This was
>> reflected in the man page.
>>
>> d089eba (setup: sanitize absolute and funny paths in get_pathspec())
>> removed this check without reflecting the change in the man page.
>
> Sounds good.

When I first read it, however, I thought that the "removal" meant that the
rewrite made the code riskier by accepting nonsense, which turns out not
to be what the author meant.  It was more like "instead of rejecting,
accept these paths after normalizing", no?

```

## Nguyen Thai Ngoc Duy, 2011-04-02 08:52

Subject: Re: [PATCH] Documentation/git-update-index.txt: Remove obsolete note
Message-ID: <BANLkTi=gadRz0XXp2Jd1Jnv7hH4fbnE45Q@mail.gmail.com>
URL: https://gitlist.dev/e/BANLkTi%3DgadRz0XXp2Jd1Jnv7hH4fbnE45Q%40mail.gmail.com
In-Reply-To: <7v7hbfj7d6.fsf@alter.siamese.dyndns.org>

```
On Fri, Apr 1, 2011 at 4:41 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
>
>> On Wed, Mar 30, 2011 at 8:01 PM, Jakob Pfender <jpfender@elegosoft.com> wrote:
>>> 8dcf39 (Prevent bogus paths from being added to the index) introduced a
>>> check for files beginning with '.', preventing path names such as
>>> `./file`, `dir/./file` or `dir/../file` from being added. This was
>>> reflected in the man page.
>>>
>>> d089eba (setup: sanitize absolute and funny paths in get_pathspec())
>>> removed this check without reflecting the change in the man page.
>>
>> Sounds good.
>
> When I first read it, however, I thought that the "removal" meant that the
> rewrite made the code riskier by accepting nonsense, which turns out not
> to be what the author meant.  It was more like "instead of rejecting,
> accept these paths after normalizing", no?
>

Yes it's more like that.
-- 
Duy

```
