From: Junio C Hamano <gitster@pobox.com>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: el24614 <el24614@mail.ntua.gr>, git@vger.kernel.org
Subject: Re: Probably typographic error in tutorial 2
Date: Mon, 28 Apr 2025 11:37:05 -0700 [thread overview]
Message-ID: <xmqqzfg0ceum.fsf@gitster.g> (raw)
In-Reply-To: <CAPig+cSfbW9zG0Jv_t8QLFz6SPHFk=2g-eDirEpX8D0ytNWpXA@mail.gmail.com> (Eric Sunshine's message of "Sun, 27 Apr 2025 17:54:35 -0400")
Eric Sunshine <sunshine@sunshineco.com> writes:
> On Sun, Apr 27, 2025 at 5:44 PM el24614 <el24614@mail.ntua.gr> wrote:
>> I think in tutorial 2 (https://git.scm.com/docs/gittutorial-2) in the
>> first code box the second time that file.txt is edited ($ echo 'hello
>> world!' >file.txt) there should be an additional ">" because a single
>> one will overwrite the contents. As far as i understand from what
>> follows bellow, the text should be appended.
>
> Presumably you're talking about this example?
>
> $ echo 'hello world' > file.txt
> $ git add .
> $ git commit -a -m "initial commit"
> ...
> $ echo 'hello world!' >file.txt
> $ git commit -a -m "add emphasis"
>
> Note that the initial content of `file.txt` is "hello world", whereas
> the updated content is "hello world!" with trailing exclamation point,
> so the content of the file does change (indeed, the commit message
> "add emphasis" hints at the way in which it changes). As such, the
> example appears to be fine as-is and does not need to be changed to
> use ">>" instead of ">".
>
> That's not to say the example is ideal since the difference of "!" is
> potentially difficult to spot. Had it instead been:
>
> $ echo 'HELLO WORLD' >file.txt
>
> or some other more obvious change, it probably would have been better.
> Please feel free to submit a patch to improve the documentation if you
> think such a change would help.
Or append "Goodbye world" to pair well with the first sentence?
By the way, I noticed that the URL given in the original post gives
a log-in page. IT IS *NOT* the git-scm.com that is associated with
this project, but is somebody else.
The URL the original poster meant is probably
https://git-scm.com/docs/gittutorial-2
I do not think the typo is malicious, though, and scm.com itself is
run by folks who have valid reasons to own the domain.
prev parent reply other threads:[~2025-04-28 18:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-27 21:02 Probably typographic error in tutorial 2 el24614
2025-04-27 21:54 ` Eric Sunshine
2025-04-28 18:37 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqzfg0ceum.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=el24614@mail.ntua.gr \
--cc=git@vger.kernel.org \
--cc=sunshine@sunshineco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).