PHANTOM
🇮🇳 IN
Skip to content

docs: remove {litdd} usage#2215

Open
MuxaJIbI4 wants to merge 1 commit intogit:masterfrom
MuxaJIbI4:remove-litdd
Open

docs: remove {litdd} usage#2215
MuxaJIbI4 wants to merge 1 commit intogit:masterfrom
MuxaJIbI4:remove-litdd

Conversation

@MuxaJIbI4
Copy link

No description provided.

*** Problem.
{litdd} is used as alias for -- (when not inside backticks) because --
is a reserved text in asciidoc. There is some problems with this:
- need to remember that in some cases -- should be replaced with {litdd}
- unnecessary config options when exporting adoc to other formats
- in HTML it looks like "--" instead of "--" (it works, but
   browser should correctly decode hex symbols in html link:
   see htmldocs/git-sh-i18n.html)

*** Solution
For better readability just escape -- using \.
This is default asciidoc mechanism that don't need any configuration.
Tested with "make all doc" - links inside linkgit: work.

Signed-off-by: samonon <samonon@gmail.com>
@gitgitgadget-git
Copy link

Welcome to GitGitGadget

Hi @MuxaJIbI4, and welcome to GitGitGadget, the GitHub App to send patch series to the Git mailing list from GitHub Pull Requests.

Please make sure that either:

  • Your Pull Request has a good description, if it consists of multiple commits, as it will be used as cover letter.
  • Your Pull Request description is empty, if it consists of a single commit, as the commit message should be descriptive enough by itself.

You can CC potential reviewers by adding a footer to the PR description with the following syntax:

CC: Revi Ewer <revi.ewer@example.com>, Ill Takalook <ill.takalook@example.net>

NOTE: DO NOT copy/paste your CC list from a previous GGG PR's description,
because it will result in a malformed CC list on the mailing list. See
example.

Also, it is a good idea to review the commit messages one last time, as the Git project expects them in a quite specific form:

  • the lines should not exceed 76 columns,
  • the first line should be like a header and typically start with a prefix like "tests:" or "revisions:" to state which subsystem the change is about, and
  • the commit messages' body should be describing the "why?" of the change.
  • Finally, the commit messages should end in a Signed-off-by: line matching the commits' author.

It is in general a good idea to await the automated test ("Checks") in this Pull Request before contributing the patches, e.g. to avoid trivial issues such as unportable code.

Contributing the patches

Before you can contribute the patches, your GitHub username needs to be added to the list of permitted users. Any already-permitted user can do that, by adding a comment to your PR of the form /allow. A good way to find other contributors is to locate recent pull requests where someone has been /allowed:

Both the person who commented /allow and the PR author are able to /allow you.

An alternative is the channel #git-devel on the Libera Chat IRC network:

<newcontributor> I've just created my first PR, could someone please /allow me? https://github.com/gitgitgadget/git/pull/12345
<veteran> newcontributor: it is done
<newcontributor> thanks!

Once on the list of permitted usernames, you can contribute the patches to the Git mailing list by adding a PR comment /submit.

If you want to see what email(s) would be sent for a /submit request, add a PR comment /preview to have the email(s) sent to you. You must have a public GitHub email address for this. Note that any reviewers CC'd via the list in the PR description will not actually be sent emails.

After you submit, GitGitGadget will respond with another comment that contains the link to the cover letter mail in the Git mailing list archive. Please make sure to monitor the discussion in that thread and to address comments and suggestions (while the comments and suggestions will be mirrored into the PR by GitGitGadget, you will still want to reply via mail).

If you do not want to subscribe to the Git mailing list just to be able to respond to a mail, you can download the mbox from the Git mailing list archive (click the (raw) link), then import it into your mail program. If you use GMail, you can do this via:

curl -g --user "<EMailAddress>:<Password>" \
    --url "imaps://imap.gmail.com/INBOX" -T /path/to/raw.txt

To iterate on your change, i.e. send a revised patch or patch series, you will first want to (force-)push to the same branch. You probably also want to modify your Pull Request description (or title). It is a good idea to summarize the revision by adding something like this to the cover letter (read: by editing the first comment on the PR, i.e. the PR description):

Changes since v1:
- Fixed a typo in the commit message (found by ...)
- Added a code comment to ... as suggested by ...
...

To send a new iteration, just add another PR comment with the contents: /submit.

Need help?

New contributors who want advice are encouraged to join git-mentoring@googlegroups.com, where volunteers who regularly contribute to Git are willing to answer newbie questions, give advice, or otherwise provide mentoring to interested contributors. You must join in order to post or view messages, but anyone can join.

You may also be able to find help in real time in the developer IRC channel, #git-devel on Libera Chat. Remember that IRC does not support offline messaging, so if you send someone a private message and log out, they cannot respond to you. The scrollback of #git-devel is archived, though.

@MuxaJIbI4
Copy link
Author

Hi @dscho, this is my first GitGitGadget PR. Could you please /allow me so I can submit it to the mailing list? Thanks!

@dscho
Copy link
Member

dscho commented Feb 23, 2026

/allow

@gitgitgadget-git
Copy link

User MuxaJIbI4 is now allowed to use GitGitGadget.

@MuxaJIbI4
Copy link
Author

/submit

@gitgitgadget-git
Copy link

Submitted as pull.2215.git.git.1771846234706.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git/ pr-git-2215/MuxaJIbI4/remove-litdd-v1

To fetch this version to local tag pr-git-2215/MuxaJIbI4/remove-litdd-v1:

git fetch --no-tags https://github.com/gitgitgadget/git/ tag pr-git-2215/MuxaJIbI4/remove-litdd-v1

@dscho
Copy link
Member

dscho commented Feb 23, 2026

@MuxaJIbI4 And please force-push next time and avoid opening a new PR. It's not necessary to open multiple PRs for the same contribution. Just force push. GitGitGadget would get really confused anyway if you sent multiple iterations from multiple PRs and not from the same PR.

@MuxaJIbI4
Copy link
Author

@MuxaJIbI4 And please force-push next time and avoid opening a new PR. It's not necessary to open multiple PRs for the same contribution. Just force push. GitGitGadget would get really confused anyway if you sent multiple iterations from multiple PRs and not from the same PR.

Sorry, first timer here.
So PR doesn't care about commit hash - just that it I request to pull from HEAD of branch 'xxx'?
After reading CodingGuidelines/SubmittingPatches/MyFirstContribution I did like 4 amends for better commit message. Then force-pushed to Github and created new PR each time since history changed. Maybe I should have prepared better.

@dscho
Copy link
Member

dscho commented Feb 23, 2026

Sorry, first timer here.

No worries, I didn't mean to criticize, I meant to help.

So PR doesn't care about commit hash - just that it I request to pull from HEAD of branch 'xxx'?

Yes, you can update PRs, so the commit hash does not have to stay fixed. What matters is what commit is the tip commit at the time you issue the /submit command.

The first time you submit, it will send an iteration. And the next time you submit, it will send a new iteration if the tip commit has changed. It will then also augment the submission by the range-diff, which is very nice for seasoned reviewers to see at a glance what you changed between iterations.

@gitgitgadget-git
Copy link

Junio C Hamano wrote on the Git mailing list (how to reply to this email):

"Michael Ryzhikov via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: samonon <samonon@gmail.com>
>
> *** Problem.
> {litdd} is used as alias for -- (when not inside backticks) because --
> is a reserved text in asciidoc. There is some problems with this:
> - need to remember that in some cases -- should be replaced with {litdd}
> - unnecessary config options when exporting adoc to other formats
> - in HTML it looks like "&#x2d;&#x2d;" instead of "--" (it works, but
>    browser should correctly decode hex symbols in html link:
>    see htmldocs/git-sh-i18n.html)
>
> *** Solution
> For better readability just escape -- using \.
> This is default asciidoc mechanism that don't need any configuration.
> Tested with "make all doc" - links inside linkgit: work.

Hmph, I do not quite see the point of this churn.  We'd need to
remember to do \-- instead of doing {litdd}, either way.

I do not know what you want to say with "when exporting to other
formats", as we already are formatting these source files into HTML
and manual pages.

@gitgitgadget-git
Copy link

Михаил Рыжиков wrote on the Git mailing list (how to reply to this email):

On Mon, Feb 23, 2026 at 9:20 PM Junio C Hamano <gitster@pobox.com> wrote:
> Hmph, I do not quite see the point of this churn.  We'd need to
> remember to do \-- instead of doing {litdd}, either way.
>
> I do not know what you want to say with "when exporting to other
> formats", as we already are formatting these source files into HTML
> and manual pages.

Let this e-mail be a summary post for similar suggestions.
If there is a reason to continue using legacy fix {litdd} there needs
to be an example
where it breaks output with current tools/setups (or even may be future setups).
If it can be replaced there needs to be a list of required tests for
all setups (see 2.).

1. I searched this mailing list for 'litdd' references (links will be
in the end) and understood
that it was introduced because of changes in asciidoc syntax (--
became emdash) and
bugs in asciidoc* converter more than 10 years ago. Should it be used
still for legacy code support?
I tested (cygwin + asciidoc) 'make all doc' and it works correctly
(but maybe it's only for me).
Since '\--' is a default asciidoc syntax for disabling text
replacement it should be used
for writing docs and converters now should know about this syntax.

2. What should be tested whether replacing {litdd} with '\--' doesn't
regress with current tools?
Should it work correctly (and create same textual output):
- with Win/Mac and all types of Linux/Unix/BSD?
- with all converters (including older versions): asciidoc, asciidoctor, etc...
- with all output formats (man, html, info, pdf, docbook, etc...)?
- with 'Git for Windows' repo and other forks?
Who can take their time and test all this?
Or release docs should come from a single source (like manpages and html docs
at https://www.kernel.org/pub/software/scm/git)?

3. Development discussion forum.
3.1 I apologize for sending it directly to this mailing list - maybe
It should have been
discussed somewhere else beforehand? For example, Discord? Mailing
list is SO old school.
3.2 Maybe there should be a discord channel #docs for Git
documentation development?

-----------------------------------------------------------------------------
Previous important references to {litdd} in this mailing list. My
comments start with >>

https://lore.kernel.org/git/20110629053510.GC28690@elie/
[PATCH 1/2 maint] Documentation: quote double-dash for AsciiDoc
Use "\--" to avoid such misformatting in sentences in which "--"
represents a literal
double-minus command line argument that separates options and revs from
pathspecs, and use "{litdd}" in cases where the double-dash is embedded
in the command name.  The latter is just for consistency with
v1.7.3-rc0~13^2 (Work around em-dash handling in newer AsciiDoc, 2010-08-23).

https://lore.kernel.org/git/20120426085156.GB22819@sigill.intra.peff.net/
[PATCH] docs: stop using asciidoc no-inline-literal

https://lore.kernel.org/git/20150513045650.GA6070@peff.net/
[PATCH 0/8] asciidoc fixups

https://lore.kernel.org/git/1462220405-12408-2-git-send-email-larsxschneider@gmail.com/
[PATCH v3 1/2] Documentation: fix linkgit references
>> previous attempt to remove {litdd}

https://lore.kernel.org/git/20171029211308.272673-1-sandals@crustytoothpaste.net/
[PATCH 0/2] Convert SubmittingPatches to AsciiDoc

https://lore.kernel.org/git/20180510071103.GC31779@sigill.intra.peff.net/
There are certainly a few that can't, though (e.g., config.txt uses
linkgit:git-web{litdd}browse[1]).
I agree that "\--" is less ugly there (and seems to work on my modern asciidoc).
There's some history on the litdd versus "\--" choice in 565e135a1e
(Documentation:
quote double-dash for AsciiDoc, 2011-06-29). That in turn references
the 2839478774
(Work around em-dash handling in newer AsciiDoc, 2010-08-23),
but I wouldn't be surprised if all of that is now obsolete with our
AsciiDoc 8+ requirement.

https://lore.kernel.org/git/20190320181715.GJ31362@pobox.com/
Re: [PATCH] asciidoctor-extensions: provide `<refmiscinfo/>`

https://lore.kernel.org/git/xmqqsg2q9xts.fsf@gitster.g/
Re: [PATCH 0/6] AsciiDoc vs Asciidoctor, once again  (14.05.2021)
A typesetting rule like "instead of double-dashes --, use {litdd}" is
an acceptable way out.
At least that wouldn't constrain what the final product that gets
delivered to the end-users can say.

https://lore.kernel.org/git/20220406184122.4126898-1-tmz@pobox.com/
[PATCH] doc: replace "--" with {litdd} in credential-cache/fsmonitor
Asciidoc renders `--` as em-dash.  This is not appropriate for command names.
It also breaks linkgit links to these commands.
>> Currently it doesn't break linkgit: (but may be only for me).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants