threads / patch / 26927

patchDocumentation/git-update-index.txt: Remove obsolete note

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

## tl;dr

5 messages between Mar 30, 2011 and Apr 2, 2011. Diffs are folded; open one to read it.

replies: 4people: 3as markdown or json

Jakob Pfender· Mar 30, 2011, 13:01 UTC · lore

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(-)
Show changes to Documentation/git-update-index.txt +2 −4
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· Mar 31, 2011, 12:15 UTC · re: Jakob Pfender · lore

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

On Wed, Mar 30, 2011 at 8:01 PM, Jakob Pfender <jpfender@elegosoft.com> wrote:
Show 7 quoted lines
> 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.
Show 8 quoted lines
>  <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· Mar 31, 2011, 15:18 UTC · re: Nguyen Thai Ngoc Duy · lore

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

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· Mar 31, 2011, 21:41 UTC · re: Nguyen Thai Ngoc Duy · lore

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

Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
Show 10 quoted lines
> 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· Apr 2, 2011, 08:52 UTC · re: Junio C Hamano · lore

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

On Fri, Apr 1, 2011 at 4:41 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 18 quoted lines
> 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

← back to recent threads