From: Junio C Hamano <gitster@pobox.com>
To: "Julia Evans via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, "D. Ben Knoble" <ben.knoble@gmail.com>,
Julia Evans <julia@jvns.ca>
Subject: Re: [PATCH] doc: git-diff: rewrite EXAMPLES section
Date: Tue, 03 Nov 2026 11:44:16 -0800 [thread overview]
Message-ID: <xmqqbj857l9r.fsf@gitster.g> (raw)
In-Reply-To: <pull.2293.git.1793720007182.gitgitgadget@gmail.com> (Julia Evans via GitGitGadget's message of "Tue, 03 Nov 2026 15:33:27 +0000")
"Julia Evans via GitGitGadget" <gitgitgadget@gmail.com> writes:
> Here's what one of the tables looks like on an 80-character terminal
> with a little bit of wrapping.
>
> ┌─────────────────────────┬───────────────────────┐
> │Ignore all whitespace │ git diff │
> │changes │ --ignore-all-space │
> ├─────────────────────────┼───────────────────────┤
> │Show which individual │ git diff --word-diff │
> │words changed instead of │ │
> │the whole line │ │
> └─────────────────────────┴───────────────────────┘
Personally, I would not want to see these line-wrapped sentences in
tables, which makes it impossible to cut-and-paste. But preferences
vary from person to person, of course, on these things.
> -Various ways to check your working tree::
> -+
> -------------
> -$ git diff <1>
> -$ git diff --cached <2>
> -$ git diff HEAD <3>
> -$ git diff AUTO_MERGE <4>
> -------------
> -+
> -<1> Changes in the working tree not yet staged for the next commit.
> -<2> Changes between the index and your last commit; what you
> - would be committing if you run `git commit` without `-a` option.
> -<3> Changes in the working tree since your last commit; what you
> - would be committing if you run `git commit -a`
> -<4> Changes in the working tree you've made to resolve textual
> - conflicts so far.
> ...
> +[cols="1,1"]
> +|===
> +|Show unstaged changes
> +|`git diff`
> +
> +|Show staged changes
> +|`git diff --staged`
Do not sneak this change into an unrelated "change the format to use
table to make it readable" topic. Doing this change to just this
single example would be a severe regression.
Look at SYNOPSIS of "git help diff" and notice there is no mention
of "--staged". The description on "--cached" explains it as a
synonym for it. If we wanted to promote "--staged" (which I would
not personally support), we'd need to do matching changes to the
main part of the text.
> +|Show all changes since the latest commit
> +|`git diff HEAD`
> +|===
Yes, as you mentioned in the commentary, loss of AUTO_MERGE is a
regression. I do not see a reason why you needed to drop it? Is it
because some external limitation like you cannot have a table with
more than 3 rows or something?
Thanks.
next prev parent reply other threads:[~2026-11-03 19:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 15:33 [PATCH] doc: git-diff: rewrite EXAMPLES section Julia Evans via GitGitGadget
2026-11-03 17:16 ` Julia Evans
2026-11-03 19:44 ` Junio C Hamano [this message]
2026-11-03 19:52 ` Julia Evans
2026-11-03 20:33 ` Junio C Hamano
2026-11-03 20:45 ` Julia Evans
2026-11-03 21:42 ` Junio C Hamano
2026-11-05 15:40 ` [PATCH v2] " Julia Evans via GitGitGadget
2026-11-05 16:46 ` Junio C Hamano
2026-11-05 18:18 ` Junio C Hamano
2026-11-05 17:23 ` Tuomas Ahola
2026-11-05 19:45 ` Junio C Hamano
2026-11-05 19:46 ` Junio C Hamano
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=xmqqbj857l9r.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=ben.knoble@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=julia@jvns.ca \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.