threads / patch / 50039

patchdoc: improve grammar in git-update-index

Subject: [PATCH] doc: improve grammar in git-update-index

## tl;dr

4 messages between Dec 14, 2018 and Dec 26, 2018. Diffs are folded; open one to read it.

replies: 3people: 3as markdown or json

Anthony Sottile· Dec 14, 2018, 21:25 UTC · lore
Signed-off-by: Anthony Sottile <asottile@umich.edu>
---
 Documentation/git-update-index.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to Documentation/git-update-index.txt +1 −1
diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt
index 1c4d146a4..9c03ca167 100644
--- a/Documentation/git-update-index.txt
+++ b/Documentation/git-update-index.txt
@@ -326,7 +326,7 @@ inefficient `lstat(2)`.  If your filesystem is one of them, you
 can set "assume unchanged" bit to paths you have not changed to
 cause Git not to do this check.  Note that setting this bit on a
 path does not mean Git will check the contents of the file to
-see if it has changed -- it makes Git to omit any checking and
+see if it has changed -- it means Git will skip any checking and
 assume it has *not* changed.  When you make changes to working
 tree files, you have to explicitly tell Git about it by dropping
 "assume unchanged" bit, either before or after you modify them.
-- 
2.17.1
Philip Oakley· Dec 15, 2018, 17:06 UTC · re: Anthony Sottile · lore

Re: [PATCH] doc: improve grammar in git-update-index

On 14/12/2018 21:25, Anthony Sottile wrote:
Show 18 quoted lines
> Signed-off-by: Anthony Sottile <asottile@umich.edu>
> ---
>   Documentation/git-update-index.txt | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt
> index 1c4d146a4..9c03ca167 100644
> --- a/Documentation/git-update-index.txt
> +++ b/Documentation/git-update-index.txt
> @@ -326,7 +326,7 @@ inefficient `lstat(2)`.  If your filesystem is one of them, you
>   can set "assume unchanged" bit to paths you have not changed to
>   cause Git not to do this check.  Note that setting this bit on a
>   path does not mean Git will check the contents of the file to
> -see if it has changed -- it makes Git to omit any checking and
> +see if it has changed -- it means Git will skip any checking and
>   assume it has *not* changed.  When you make changes to working
>   tree files, you have to explicitly tell Git about it by dropping
>   "assume unchanged" bit, either before or after you modify them.

Doesn't this also need the caveat that it is _a promise by the user_ that they will not change the file, such that Git doesn't need to keep checking, and that occasionally Git will check, or may perform unexpected actions if the user has the wrong mental model.

-- 
Philip
Anthony Sottile· Dec 16, 2018, 00:21 UTC · re: Philip Oakley · lore

Re: [PATCH] doc: improve grammar in git-update-index

On Sat, Dec 15, 2018 at 9:18 AM Philip Oakley <philipoakley@iee.org> wrote:
Show 31 quoted lines
>
> On 14/12/2018 21:25, Anthony Sottile wrote:
> > Signed-off-by: Anthony Sottile <asottile@umich.edu>
> > ---
> >   Documentation/git-update-index.txt | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt
> > index 1c4d146a4..9c03ca167 100644
> > --- a/Documentation/git-update-index.txt
> > +++ b/Documentation/git-update-index.txt
> > @@ -326,7 +326,7 @@ inefficient `lstat(2)`.  If your filesystem is one of them, you
> >   can set "assume unchanged" bit to paths you have not changed to
> >   cause Git not to do this check.  Note that setting this bit on a
> >   path does not mean Git will check the contents of the file to
> > -see if it has changed -- it makes Git to omit any checking and
> > +see if it has changed -- it means Git will skip any checking and
> >   assume it has *not* changed.  When you make changes to working
> >   tree files, you have to explicitly tell Git about it by dropping
> >   "assume unchanged" bit, either before or after you modify them.
>
> Doesn't this also need the caveat that it is _a promise by the user_
> that they will not change the file, such that Git doesn't need to keep
> checking, and that occasionally Git will check, or may perform
> unexpected actions if the user has the wrong mental model.
>
> --
>
> Philip
>
>

yep, the rest of the documentation in this file explains that in detail -- I'm just fixing up a sentence that doesn't read well :)

Junio C Hamano· Dec 26, 2018, 18:12 UTC · re: Philip Oakley · lore

Re: [PATCH] doc: improve grammar in git-update-index

Philip Oakley <philipoakley@iee.org> writes:
Show 24 quoted lines
> On 14/12/2018 21:25, Anthony Sottile wrote:
>> Signed-off-by: Anthony Sottile <asottile@umich.edu>
>> ---
>>   Documentation/git-update-index.txt | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt
>> index 1c4d146a4..9c03ca167 100644
>> --- a/Documentation/git-update-index.txt
>> +++ b/Documentation/git-update-index.txt
>> @@ -326,7 +326,7 @@ inefficient `lstat(2)`.  If your filesystem is one of them, you
>>   can set "assume unchanged" bit to paths you have not changed to
>>   cause Git not to do this check.  Note that setting this bit on a
>>   path does not mean Git will check the contents of the file to
>> -see if it has changed -- it makes Git to omit any checking and
>> +see if it has changed -- it means Git will skip any checking and
>>   assume it has *not* changed.  When you make changes to working
>>   tree files, you have to explicitly tell Git about it by dropping
>>   "assume unchanged" bit, either before or after you modify them.
>
> Doesn't this also need the caveat that it is _a promise by the user_
> that they will not change the file, such that Git doesn't need to keep
> checking, and that occasionally Git will check, or may perform
> unexpected actions if the user has the wrong mental model.
True.  

Setting bit _allows_, not necessarily "makes", Git to assume that the path will not be modified by the user when it is convenient for Git to make that assumption (e.g. instead of reading a blob out of the object database, Git may mmap the corresponding working tree file when they are the same and Git thinks using the latter is more efficient). When Git finds it more convenient to check if they are the same, the bit does not stop Git from doing so.

So in that sense, both the text before and after the patch is bad.
	Note that setting this bit on a path does not mean Git will
	always check, or will never check, the contents of the file
	to see if it has changed.  The bit allows Git to assume that
	the file in the working tree is identical to what is in the
	index when it is convenient to do so.  When you make
	changes...
or something like that.

← back to recent threads