git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] howto: Use all-space indentation in ASCII art

From
DWDirk Wallenstein <halsmit@t-online.de>
Date
Jul 16, 2013, 18:01 UTC
Message-ID
<20130716180158.GA7524@bottich>
In-Reply-To
<CAPc5daXZxkLOJwzaoSMZvJ87zYvns1MeYZU=RoEK=CQYP1qpag@mail.gmail.com>
On Tue, Jul 16, 2013 at 10:13:28AM -0700, Junio C Hamano wrote:
Show 5 quoted lines
> > Why would you want to limit those files to be source for HTML only?
> >
> > The HTML after this patch is still fine.
> 
> Have you thought the reason why the formatted result _before_ the patch is good?

No, as I said, *.txt suffixes tell me there is text in there and not source code. But what is more important is that they are installed (by Git) as is (obviously) into share/doc. I'm happy to learn about the conversion through these posts, but the installation is flawed.

Show 6 quoted lines
> These *.txt files are asciidoc formatted source files. They are meant
> to be easy to read and edit without distracting mark-ups (unlike roff
> and html), but with one big precondition: your tab-width ought to be
> 8. That is how asciidoc expands the tab when producing the formatted
> output, and that is why the formatted result _before_ the patch is
> good.

asciidoc replaces the other spaces in the sketch with spaces in the result. Hard to believe it stops doing that if it is accidentally a sequence of 8 spaces. And spaces are invisible by design. Whitespace only distracts if it leads to a wrong result.

> 
> Expanding these tabs to all spaces do not buy us anything, other than
> source code bloat, and with one downside.

Correctness maybe, if you open them in an editor to read them. Imagine the code bloat when the installation procedure expands the tabs so that the final installation is correct.

> It would give a false impression that it somehow is OK to open these
> *.txt files with a wrong tab-width setting, and even worse, edit them.
> You may even type a new tab yourself to indent by 4 places, and
> formatted result will be broken by such a person.

Luckily there are whitespace checks for mixed space and/or tab-indent. The right approach would probably be to have no tabs indent in any of these files. I'm happy to assist ;)

> 
> It would signal that your tab-width setting is not suitable to
> view/edit these files if the elements in the illustration do not line
> up. View it as a bonus safety feature ;-)

gitattributes could solve that much more reliable if there wasn't any tab indentation allowed.

In the end, this is installed as documentation with a requirement on the tab-width of any reader application used. The easiest and most foolproof solution without introducing errors is to simply expand these tabs. Again, the current installation is flawed.

-- 
Cheers,
  Dirk
Previous: Junio C HamanoNext: Dirk Wallenstein
Message 5 of 16 in “howto: Use all-space indentation in ASCII art”
  1. howto: Use all-space indentation in ASCII artDirk Wallenstein, Jul 15, 2013
  2. Junio C HamanoJul 15, 2013
  3. Dirk WallensteinJul 16, 2013
  4. Junio C HamanoJul 16, 2013
  5. Dirk WallensteinJul 16, 2013
  6. 0/2 Remove tabs from howto documentsDirk Wallenstein, Jul 31, 2013
  7. Fredrik GustafssonJul 31, 2013
  8. Jonathan NiederJul 16, 2013
  9. Dirk WallensteinJul 16, 2013
  10. A Large Angry SCMJul 16, 2013
  11. 1/2 howto: Suppress indentation with tabsDirk Wallenstein, Jul 31, 2013
  12. 2/2 howto: Eliminate all tabsDirk Wallenstein, Jul 31, 2013
  13. Junio C HamanoJul 31, 2013
  14. Dirk WallensteinJul 31, 2013
  15. Piotr KrukowieckiAug 3, 2013
  16. Junio C HamanoAug 5, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.