diff mbox series

[v3,01/16] doc: pull: explain what is a fast-forward

Message ID 20201205195313.1557473-2-felipe.contreras@gmail.com (mailing list archive)
State Superseded
Headers show
Series [v3,01/16] doc: pull: explain what is a fast-forward | expand

Commit Message

Felipe Contreras Dec. 5, 2020, 7:52 p.m. UTC
We want users to know what is a fast-forward in order to understand the
default warning.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 Documentation/git-pull.txt | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Junio C Hamano Dec. 7, 2020, 8:45 p.m. UTC | #1
Felipe Contreras <felipe.contreras@gmail.com> writes:

> We want users to know what is a fast-forward in order to understand the
> default warning.

The intention is very good, but ...

> +------------
> +	  A---B---C master on origin
> +	 /
> +    D---E master
> +------------
> +
> +Then `git pull` will merge in a fast-foward way up to the new master.

... I find the phrase "in a fast-forward way" a bit awkward.
Perhaps use the 'fast-forward' as a verb, i.e.

	Then `git pull` notices that what is being merged is a
	descendant of our current branch, and fast-forwards our
	'master' branch to the commit.

or something like that?  It should be in line with the spirit in
which glossary defines fast-forward, I would think.

> +
> +------------
> +    D---E---A---B---C master, origin/master
> +------------
> +
> +However, a non-fast-foward case looks very different.

s/foward/forward/ (the same typo exists above);

>  ------------
>  	  A---B---C master on origin
>  	 /
Felipe Contreras Dec. 7, 2020, 10:22 p.m. UTC | #2
On Mon, Dec 7, 2020 at 2:45 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
> > We want users to know what is a fast-forward in order to understand the
> > default warning.
>
> The intention is very good, but ...
>
> > +------------
> > +       A---B---C master on origin
> > +      /
> > +    D---E master
> > +------------
> > +
> > +Then `git pull` will merge in a fast-foward way up to the new master.
>
> ... I find the phrase "in a fast-forward way" a bit awkward.
> Perhaps use the 'fast-forward' as a verb, i.e.
>
>         Then `git pull` notices that what is being merged is a
>         descendant of our current branch, and fast-forwards our
>         'master' branch to the commit.
>
> or something like that?  It should be in line with the spirit in
> which glossary defines fast-forward, I would think.

The glossary defines a fast-forward as:

  A fast-forward is a special type of `merge`

So, if you consider "merge" a noun, then a fast-forward is an
adjective. If you consider it a verb, then it's an adverb. But it's
not a verb.

If it was a verb, then we should have `git fast-forward`, which may
not be a terrible idea, but right now a fast-forward is a modifier.

At least that's what I have in my mind, and the glossary seems to agree.

> > +
> > +------------
> > +    D---E---A---B---C master, origin/master
> > +------------
> > +
> > +However, a non-fast-foward case looks very different.
>
> s/foward/forward/ (the same typo exists above);

All right.
Elijah Newren Dec. 7, 2020, 10:40 p.m. UTC | #3
Hi,

On Mon, Dec 7, 2020 at 2:22 PM Felipe Contreras
<felipe.contreras@gmail.com> wrote:
>
> On Mon, Dec 7, 2020 at 2:45 PM Junio C Hamano <gitster@pobox.com> wrote:
> >
> > Felipe Contreras <felipe.contreras@gmail.com> writes:
> >
> > > We want users to know what is a fast-forward in order to understand the
> > > default warning.
> >
> > The intention is very good, but ...
> >
> > > +------------
> > > +       A---B---C master on origin
> > > +      /
> > > +    D---E master
> > > +------------
> > > +
> > > +Then `git pull` will merge in a fast-foward way up to the new master.
> >
> > ... I find the phrase "in a fast-forward way" a bit awkward.
> > Perhaps use the 'fast-forward' as a verb, i.e.
> >
> >         Then `git pull` notices that what is being merged is a
> >         descendant of our current branch, and fast-forwards our
> >         'master' branch to the commit.
> >
> > or something like that?  It should be in line with the spirit in
> > which glossary defines fast-forward, I would think.
>
> The glossary defines a fast-forward as:
>
>   A fast-forward is a special type of `merge`
>
> So, if you consider "merge" a noun, then a fast-forward is an
> adjective. If you consider it a verb, then it's an adverb. But it's
> not a verb.

A square is a special type of a rectangle, but that doesn't make
"square" an adjective; both square and rectangle are nouns.

> If it was a verb, then we should have `git fast-forward`, which may
> not be a terrible idea, but right now a fast-forward is a modifier.
>
> At least that's what I have in my mind, and the glossary seems to agree.

If you read the release notes and even various messages printed by
git, "fast-forwards", "fast-forwarded", "fast-forwarding", and "to
fast-forward" all appear multiple times.  And yes, "fast-forward" also
appears multiple times as a noun in addition to the various uses as a
verb.  So, I'd say the glossary just isn't comprehensive because in
this case we have a word that serves as both a noun and a verb.


Going back to the text Junio highlighted, I agree with him that the
phrase looks really awkward, and much prefer his suggestion
(regardless of whether it aligns with the current glossary).

> > > +
> > > +------------
> > > +    D---E---A---B---C master, origin/master
> > > +------------
> > > +
> > > +However, a non-fast-foward case looks very different.
> >
> > s/foward/forward/ (the same typo exists above);
>
> All right.
>
> --
> Felipe Contreras
Junio C Hamano Dec. 7, 2020, 11:08 p.m. UTC | #4
Elijah Newren <newren@gmail.com> writes:

>> > ... I find the phrase "in a fast-forward way" a bit awkward.
>> > Perhaps use the 'fast-forward' as a verb, i.e.
>> >
>> >         Then `git pull` notices that what is being merged is a
>> >         descendant of our current branch, and fast-forwards our
>> >         'master' branch to the commit.
>> >
>> > or something like that?  It should be in line with the spirit in
>> > which glossary defines fast-forward, I would think.
>> ...
> If you read the release notes and even various messages printed by
> git, "fast-forwards", "fast-forwarded", "fast-forwarding", and "to
> fast-forward" all appear multiple times.  And yes, "fast-forward" also
> appears multiple times as a noun in addition to the various uses as a
> verb.  So, I'd say the glossary just isn't comprehensive because in
> this case we have a word that serves as both a noun and a verb.

Ah, sorry, I didn't mean noun-vs-verb when I mentioned the glossary.

I thought that the idea that the word can be used as a verb, after
discussing advise() messages that tells the users that they can
"merge, rebase or fast-forward", was given and not something anybody
needs to be explained about.

The other half of what I suggested was to explain what situation is
fast-forwardable, i.e. "notices ... is a descendant of", and I made
sure that the explanation was in line with the grossary.  Without it
explained in-place in the text, readers who need to be told what a
fast-forward is needs to go to and come back from the glossary while
reading this page, which was what I tried to improve while we are
trying to find a better phrasing.
Felipe Contreras Dec. 8, 2020, 12:17 a.m. UTC | #5
On Mon, Dec 7, 2020 at 4:40 PM Elijah Newren <newren@gmail.com> wrote:
> On Mon, Dec 7, 2020 at 2:22 PM Felipe Contreras
> <felipe.contreras@gmail.com> wrote:

> > The glossary defines a fast-forward as:
> >
> >   A fast-forward is a special type of `merge`
> >
> > So, if you consider "merge" a noun, then a fast-forward is an
> > adjective. If you consider it a verb, then it's an adverb. But it's
> > not a verb.
>
> A square is a special type of a rectangle, but that doesn't make
> "square" an adjective; both square and rectangle are nouns.

Words have multiple definitions. The word "square" is both a noun, and
an adjective [1]. It's perfectly fine to say "square corner".

Just like it's perfectly fine to say "fast-forward merge", or "quick sort".

And that's how many people use it:

https://git-scm.com/docs/git-merge#_fast_forward_merge
https://docs.gitlab.com/ee/user/project/merge_requests/fast_forward_merge.html
https://www.atlassian.com/git/tutorials/using-branches/git-merge#:~:text=Fast%20Forward%20Merge

Plus there's many instances in the documentation:

* non-fast-forward update
* fast-forward merges
* fast-forward check
* "fast-forward-ness"
* fast-forward situation
* fast-forward push
* non-fast-forward pushes
* non-fast-forward reference
* fast-forward cases
* "fast-forward" merge

> > If it was a verb, then we should have `git fast-forward`, which may
> > not be a terrible idea, but right now a fast-forward is a modifier.
> >
> > At least that's what I have in my mind, and the glossary seems to agree.
>
> If you read the release notes and even various messages printed by
> git, "fast-forwards", "fast-forwarded", "fast-forwarding", and "to
> fast-forward" all appear multiple times.  And yes, "fast-forward" also
> appears multiple times as a noun in addition to the various uses as a
> verb.  So, I'd say the glossary just isn't comprehensive because in
> this case we have a word that serves as both a noun and a verb.

It can be a noun, a verb, an adjective, and an adverb. But the
question is not what it can be, but what it actually is. I'm just
telling you my rationale:

1. noun: it doesn't make sense because you don't create, pick, show,
or push a "fast-forward"
2. verb: there's no idiom to tell git "do fast-forward"
3. adjective: there are merge nouns (commits), but no instances of
fast-forward merge commits, like say octopus merge commits
4. adverb: you can tell git "do merge", and "do fast-forward merge"

So, in my opinion a fast-forward today can only logically be an adverb.

Like a bubble sort is a special type of sort, and theoretically you
can say "do a bubble", but it's just weird. My mind is left hanging: a
bubble $what? Likewise, when people say "do me a solid", I'm
annoyed... A solid $what?! They mean "a solid favor". People do it, so
it's part of language, but it doesn't stop it from being weird in my
opinion.

An adverb typically answers the question "in what way?". Do me a
favor... In what way? In a solid way. Do a sort... In what way? In a
quick way. Do a move... In what way? In a bold way. Do a merge... In
what way? In a fast-forward way.

> Going back to the text Junio highlighted, I agree with him that the
> phrase looks really awkward, and much prefer his suggestion
> (regardless of whether it aligns with the current glossary).

Normally I don't show credentials, but in this case I think it might
be relevant. I've read multiple linguists, like Noam Chomsky, and
Steven Pinker. I follow many others and read their articles. I also
read The Pinker's Sense of Style: The Thinking Person's Guide to
Writing in the 21st Century [2], which I can't recommend enough for
people writing technical documents or any other classic style. I have
an arguably successful blog with more than 200 articles and more than
1 million views, which is regularly linked from other blogs, and
technical resources. I constantly get thanked both in person, and
online for what I write. And at some point I was asked by a publisher
to write a book about Git (which I didn't feel prepared for at that
time).

So, clearly at least some people value the way I write.

I'm not trying to be stubborn here, I just honestly put effort into
the art of writing, and I do care deeply about language.

Of course I might be wrong in this particular instance, but if I am,
it's not because of lack of effort.

I think fast-forward is mainly an adverb, but even if it isn't the
main usage; it's still clearly an usage.

Cheers.

[1] https://www.merriam-webster.com/dictionary/square
[2] https://www.amazon.com/Sense-Style-Thinking-Persons-Writing/dp/0143127799
Felipe Contreras Dec. 8, 2020, 12:20 a.m. UTC | #6
On Mon, Dec 7, 2020 at 5:08 PM Junio C Hamano <gitster@pobox.com> wrote:

> I thought that the idea that the word can be used as a verb, after
> discussing advise() messages that tells the users that they can
> "merge, rebase or fast-forward", was given and not something anybody
> needs to be explained about.

I removed that in the latest version, precisely because you can't tell
git pull to resolve a diverging branch situation by doing a
"fast-forward". It's only merge or rebase.
Elijah Newren Dec. 8, 2020, 1:23 a.m. UTC | #7
On Mon, Dec 7, 2020 at 4:17 PM Felipe Contreras
<felipe.contreras@gmail.com> wrote:
>
> On Mon, Dec 7, 2020 at 4:40 PM Elijah Newren <newren@gmail.com> wrote:
> > On Mon, Dec 7, 2020 at 2:22 PM Felipe Contreras
> > <felipe.contreras@gmail.com> wrote:
>
> > > The glossary defines a fast-forward as:
> > >
> > >   A fast-forward is a special type of `merge`
> > >
> > > So, if you consider "merge" a noun, then a fast-forward is an
> > > adjective. If you consider it a verb, then it's an adverb. But it's
> > > not a verb.
> >
> > A square is a special type of a rectangle, but that doesn't make
> > "square" an adjective; both square and rectangle are nouns.
>
> Words have multiple definitions. The word "square" is both a noun, and
> an adjective [1]. It's perfectly fine to say "square corner".
>
> Just like it's perfectly fine to say "fast-forward merge", or "quick sort".
>
> And that's how many people use it:
>
> https://git-scm.com/docs/git-merge#_fast_forward_merge
> https://docs.gitlab.com/ee/user/project/merge_requests/fast_forward_merge.html
> https://www.atlassian.com/git/tutorials/using-branches/git-merge#:~:text=Fast%20Forward%20Merge
>
> Plus there's many instances in the documentation:
>
> * non-fast-forward update
> * fast-forward merges
> * fast-forward check
> * "fast-forward-ness"
> * fast-forward situation
> * fast-forward push
> * non-fast-forward pushes
> * non-fast-forward reference
> * fast-forward cases
> * "fast-forward" merge

Yeah, and the number of "fast-forward merge" instances suggest I'm
losing the battle on "fast-forward" not being a merge but a different
thing.  So maybe I'm losing multiple battles here.  :-)

> > > If it was a verb, then we should have `git fast-forward`, which may
> > > not be a terrible idea, but right now a fast-forward is a modifier.
> > >
> > > At least that's what I have in my mind, and the glossary seems to agree.
> >
> > If you read the release notes and even various messages printed by
> > git, "fast-forwards", "fast-forwarded", "fast-forwarding", and "to
> > fast-forward" all appear multiple times.  And yes, "fast-forward" also
> > appears multiple times as a noun in addition to the various uses as a
> > verb.  So, I'd say the glossary just isn't comprehensive because in
> > this case we have a word that serves as both a noun and a verb.
>
> It can be a noun, a verb, an adjective, and an adverb. But the
> question is not what it can be, but what it actually is. I'm just
> telling you my rationale:
>
> 1. noun: it doesn't make sense because you don't create, pick, show,
> or push a "fast-forward"
> 2. verb: there's no idiom to tell git "do fast-forward"
> 3. adjective: there are merge nouns (commits), but no instances of
> fast-forward merge commits, like say octopus merge commits
> 4. adverb: you can tell git "do merge", and "do fast-forward merge"
>
> So, in my opinion a fast-forward today can only logically be an adverb.
>
> Like a bubble sort is a special type of sort, and theoretically you
> can say "do a bubble", but it's just weird. My mind is left hanging: a
> bubble $what? Likewise, when people say "do me a solid", I'm
> annoyed... A solid $what?! They mean "a solid favor". People do it, so
> it's part of language, but it doesn't stop it from being weird in my
> opinion.
>
> An adverb typically answers the question "in what way?". Do me a
> favor... In what way? In a solid way. Do a sort... In what way? In a
> quick way. Do a move... In what way? In a bold way. Do a merge... In
> what way? In a fast-forward way.
>
> > Going back to the text Junio highlighted, I agree with him that the
> > phrase looks really awkward, and much prefer his suggestion
> > (regardless of whether it aligns with the current glossary).
>
> Normally I don't show credentials, but in this case I think it might
> be relevant. I've read multiple linguists, like Noam Chomsky, and
> Steven Pinker. I follow many others and read their articles. I also
> read The Pinker's Sense of Style: The Thinking Person's Guide to
> Writing in the 21st Century [2], which I can't recommend enough for
> people writing technical documents or any other classic style. I have
> an arguably successful blog with more than 200 articles and more than
> 1 million views, which is regularly linked from other blogs, and
> technical resources. I constantly get thanked both in person, and
> online for what I write. And at some point I was asked by a publisher
> to write a book about Git (which I didn't feel prepared for at that
> time).
>
> So, clearly at least some people value the way I write.
>
> I'm not trying to be stubborn here, I just honestly put effort into
> the art of writing, and I do care deeply about language.
>
> Of course I might be wrong in this particular instance, but if I am,
> it's not because of lack of effort.
>
> I think fast-forward is mainly an adverb, but even if it isn't the
> main usage; it's still clearly an usage.
>
> Cheers.
>
> [1] https://www.merriam-webster.com/dictionary/square
> [2] https://www.amazon.com/Sense-Style-Thinking-Persons-Writing/dp/0143127799

You have very compelling arguments that fast-forward often serves as
an adverb (and if I'd thought a little closer, I would have remembered
that I use "fast-forward update" myself).  You have me convinced.

However, I am somewhat less convinced that "fast-forward" doesn't also
serve as a noun or a verb.  Perhaps you are trying to argue how it
*should* be used rather than how it *is* used, in which case I don't
have any counter-arguments for you (I'm less well linguistically
trained).  But if you look at how it is used, the number of times "a
fast-forward update" is shortened to "a fast-forward" in the
documentation suggests to me it's often a noun, and the number of
times that variants such as "fast-forwards", "fast-forwarded",
"fast-forwarding", and "to fast-forward" appear in both the docs and
output messages means that it's also frequently used as a verb as
well.  The fact that Junio expressed surprise upthread ("I thought
that the idea that the word can be used as a verb...was given and not
something anybody needs to be explained about") also suggests that
usage of fast-forward as a verb is common.  Anyway, I think trying to
treat "fast-forward" as solely an adverb results in awkward phrases
like "in a fast-forward way" instead of just using the much simpler
verb form.

Also, re-reading my earlier email, it looks like it could easily come
across as curt.  My apologies if it did read that way.
Felipe Contreras Dec. 8, 2020, 2:37 p.m. UTC | #8
On Mon, Dec 7, 2020 at 7:23 PM Elijah Newren <newren@gmail.com> wrote:

> Yeah, and the number of "fast-forward merge" instances suggest I'm
> losing the battle on "fast-forward" not being a merge but a different
> thing.  So maybe I'm losing multiple battles here.  :-)

In theory it could be both. I just don't see how.

> You have very compelling arguments that fast-forward often serves as
> an adverb (and if I'd thought a little closer, I would have remembered
> that I use "fast-forward update" myself).  You have me convinced.

Great!

> However, I am somewhat less convinced that "fast-forward" doesn't also
> serve as a noun or a verb.

I'm not saying it doesn't serve as a noun or a verb. It is certainly
used in that way *in addition* to being an adverb. I'm just saying in
my opinion it's primarily an adverb.

> Perhaps you are trying to argue how it
> *should* be used rather than how it *is* used, in which case I don't
> have any counter-arguments for you (I'm less well linguistically
> trained).

Not quite. I agree it is used both as a noun and a verb. And I
wouldn't attempt to mandate how words should be used (I'm against
prescriptiveness).

I'm just arguing from the point of view of the mental model. There is
no such thing as a fast-forward object.

Take for example the word "calibration". It is a noun, but you can't
point to any calibration thing. It comes from the verb calibrating,
and such conversions are called nominalizations.

I'm currently re-reading The Sense of Style, and it's interesting that
in Chapter 2 Steven Pinker mentions precisely these nouns, which he
calls "zombie nouns". They certainly do exist, and people use them,
but they suck the lifeblood out of prose. Take for example
"comprehension checks were used as exclusion criteria" (zombie nouns),
compared to "we excluded people who failed to understand the
instructions" (live verbs).

This article from writing expert Helen Sword does a great job of
explaining them:

https://opinionator.blogs.nytimes.com/2012/07/23/zombie-nouns/

Yes, "a merge done in a fast-forward way", is a "fast-forward merge",
which can be nouned as "a fast-forward". It's just not very alive.

> The fact that Junio expressed surprise upthread ("I thought
> that the idea that the word can be used as a verb...was given and not
> something anybody needs to be explained about") also suggests that
> usage of fast-forward as a verb is common.  Anyway, I think trying to
> treat "fast-forward" as solely an adverb results in awkward phrases
> like "in a fast-forward way" instead of just using the much simpler
> verb form.

Yes, it is common also. I'm just saying unless there's a "git
fast-forward" command you can't really tell git "do a fast-forward",
what you tell git is: "do a merge in a fast-forward way". It's a valid
way of thinking, just not the way I think.

BTW, I find it interesting that there are many instances of
"fast-forward update" in the documentation, and back then I did create
a "git update" tool (essentially a copy of "git pull"), so this
suggests there's a void that such a tool certainly would fill.

With such a tool we would have "fast-forward merge", "fast-forward
pull", and "fast-forward update", which indicates that adverb is the
most natural notion.

> Also, re-reading my earlier email, it looks like it could easily come
> across as curt.  My apologies if it did read that way.

No worries. I didn't take it as such. Same from my side; I'm just
stating my opinion.

Cheers.

[1] https://github.com/felipec/git/commit/d38f1641fc33535aa3c92cf6d3a30334324d3488
Felipe Contreras Dec. 8, 2020, 6:55 p.m. UTC | #9
On Tue, Dec 8, 2020 at 8:37 AM Felipe Contreras
<felipe.contreras@gmail.com> wrote:

> Take for example the word "calibration". It is a noun, but you can't
> point to any calibration thing. It comes from the verb calibrating,
> and such conversions are called nominalizations.
>
> I'm currently re-reading The Sense of Style, and it's interesting that
> in Chapter 2 Steven Pinker mentions precisely these nouns, which he
> calls "zombie nouns". They certainly do exist, and people use them,
> but they suck the lifeblood out of prose. Take for example
> "comprehension checks were used as exclusion criteria" (zombie nouns),
> compared to "we excluded people who failed to understand the
> instructions" (live verbs).

Actually I found this video, which is more digestible and enjoyable:

Zombie Nouns and the Passive Voice in Writing
https://www.youtube.com/watch?v=sS-Txm3R3v8
diff mbox series

Patch

diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt
index 5c3fb67c01..dc812139f4 100644
--- a/Documentation/git-pull.txt
+++ b/Documentation/git-pull.txt
@@ -38,6 +38,20 @@  as set by linkgit:git-branch[1] `--track`.
 Assume the following history exists and the current branch is
 "`master`":
 
+------------
+	  A---B---C master on origin
+	 /
+    D---E master
+------------
+
+Then `git pull` will merge in a fast-foward way up to the new master.
+
+------------
+    D---E---A---B---C master, origin/master
+------------
+
+However, a non-fast-foward case looks very different.
+
 ------------
 	  A---B---C master on origin
 	 /