Thank you, Alex, for sharing the Discord link. I was just about to reference the recent discussion on this topic in Discord as you just did.
From my reading of the summary, there seems to be a strong sentiment that renaming the files could cause more problems than it would solve, particularly when it comes to Git history and Fellows/reviewers/triagers workflow. Given these potential complications, I’m inclined to think that changing the file extension may not be worth it.
Side note: I don't think Discord is that useful when referencing public conversations, this is a separated topic but because I have had troubles reading past Discord conversations, I'm extracting the relevant bits and adding them below for posterity. Expand!
Thibaud Colas — 10/21/24, 5:13 PM
Does anyone know why Django uses .txt
for its reStructuredText docs? I find myself wondering if there’s a reason why. I could use more syntax highlighting
Carlton Gibson — 10/22/24, 5:53 AM
No idea the origin: Dawn of time. You should be able to set language-file associations in your editor (per project hopefully). I’m not against you suggesting changing it to .rst but I’m not opening the batting there either
Thibaud Colas — 10/22/24, 5:54 AM
I have, just can’t do that in GitHub, and I’m hesitant to suggest this workaround for new contributors I help with docs changes
Alex — 10/22/24, 6:17 AM
Changing it makes the future easier for everyone since we use the “standard” file extension, I think the question is if the possible merge conflicts for existing branches when the change happens are worth it.
Baptiste — 10/22/24, 6:32 AM
Wouldn’t git be able to handle it if it’s a straight up rename?
Thibaud Colas — 10/22/24, 6:36 AM
yes IIRC straight-up renames should be fine, just needs some finnesse if we had to do renames and then updating file references(?)
Mariusz Felisiak — 10/22/24, 6:38 AM
I wonder if this will not break doc translations
and it will make checking git history a bit more complicated
as --follow
works only for a single file
I don’t think it’s worth doing
CodenameTim (he/him) — 10/22/24, 7:32 AM
git diff should handle renames, unless I’m misunderstanding your use case.
Mariusz Felisiak — 10/22/24, 7:45 AM
I’m taking about git log
or git blame
It’s a every day job to dig into the source of changes in the Django repository
Marijke (Mah-Rye-Kuh) — 10/22/24, 7:48 AM
A file’s Git history doesn’t move with a rename. You would have to rewrite all the historical commits if you want to retain them
Mariusz Felisiak — 10/22/24, 7:49 AM
For example:
$ git log django/db/backends/base/__init__.py
commit 28308078f397d1de36fd0da417ac7da2544ba12d
Author: Tim Graham <timograham@gmail.com>
Date: Mon Jan 12 15:20:40 2015 -0500
Fixed #22603 -- Reorganized classes in django.db.backends.
Tim renamed this file so you have to dig deeper with --follow
git log --follow django/db/backends/base/__init__.py
commit 28308078f397d1de36fd0da417ac7da2544ba12d
Author: Tim Graham <timograham@gmail.com>
Date: Mon Jan 12 15:20:40 2015 -0500
Fixed #22603 -- Reorganized classes in django.db.backends.
commit ed114e15106192b22ebb78ef5bf5bce72b419d13
Author: Adrian Holovaty <adrian@holovaty.com>
Date: Wed Jul 13 01:25:57 2005 +0000
Imported Django from private SVN repository (created from r. 8825)
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3 bcc190cf-cafb-0310-a4f2-bffc1f526a3
Marijke (Mah-Rye-Kuh) — 10/22/24, 7:51 AM
Do the SVN logs still exist somewhere? The git-svn-id
link gives me a 404 on Trac.
This is akin to programmer archeology.
Mariusz Felisiak — 10/22/24, 7:52 AM
renaming all doc files will force Fellows (and others like me) to do this every single time
Mariusz Felisiak — 10/22/24, 7:52 AM
As far as I’m aware you would have to have copy of the private SVN repository
ed114e15106192b22ebb78ef5bf5bce72b419d13 this is like a holy grail or big bang
the beginning of everything
Marijke (Mah-Rye-Kuh) — 10/22/24, 7:54 AM
These days, I am in the fortunate mental state that I often forget that SVN existed. I wouldn’t even know how it works, anymore
Marijke (Mah-Rye-Kuh) — 10/22/24, 7:54 AM
Time to slap a theme song on it
But in all seriousness, since I was looking at some code yesterday that predates the Git repo, I found it unfortunate that I couldn’t find the reasoning behind some of the lines in the code. That is under the assumption that the SVN commits would have a descriptive message, but the context usually helps.
(Not to derail Thibaud’s original question about why the RST files use the .txt
extension and whether we still want that)
Ben — 10/22/24, 8:01 AM
You can centrally mark certain commits to be excluded from git blame
I believe, if that helps
Mariusz Felisiak — 10/22/24, 8:03 AM
It won’t help
as it’s not about having less history
but about tracking to the source of specific changes
CodenameTim (he/him) — 10/22/24, 8:05 AM
Does it git log -- follow
do what we’re missing? Git - git-log Documentation
Ah single file
Boo
Marijke (Mah-Rye-Kuh) — 10/22/24, 8:05 AM
You can even configure your Git to automatically follow blames, but it has some performance implications, and you don’t control how other people configure their system.
IMO, I would say “If it ain’t broken, don’t fix it” in this case.
CodenameTim (he/him) — 10/22/24, 8:06 AM
Configuration definitely feels like something django can control
CodenameTim (he/him) — 10/22/24, 8:07 AM
But the original case (rst files using txt file extensions confusing new contributors) is arguably broken.
Marijke (Mah-Rye-Kuh) — 10/22/24, 8:10 AM
That’s a minefield. You cannot control someone’s global .gitconfig
(thank goodness), and arbitrarily messing with default behavior is confusing. It’s the same with things like .git-blame-ignore-revs
; I occasionally use it and put instructions in a README for people on activating it, but it’s all optional.
Marijke (Mah-Rye-Kuh) — 10/22/24, 8:11 AM
Fair. Someone is going to lose somewhere. But I think the impact of converting from .txt
to .rst
is much bigger than keeping it the way it is now. Of course, that doesn’t mean we shouldn’t consider it.
Thibaud Colas — 10/22/24, 8:14 AM
Going through the commit history, can confirm it’s been .txt
since the dawn of times (here’s the first ever docs file from what I can see). So I’ll just assume there wasn’t a .rst
back then and that’s about it as far as the decision to use .txt
.
I’m not going to suggest we’d want to change this, just interested in the rationale when I explain this to others. It looks like this to configure VS Code to treat the files as reStructuredText if anyone needs it:
"files.associations": {
"**/docs/**/*.txt": "restructuredtext"
}
Marijke (Mah-Rye-Kuh) — 10/22/24, 8:20 AM
If anyone needs a reminder, I listed a variant of this for Django on my blog: Quick tip: Set folder-based file associations in Visual Studio Code / Marijke Luttekes
Thibaud Colas — 10/22/24, 8:23 AM
oh if anyone did want to suggest that .rst
change, it does seem like all of the above is only pain related to existing files moving over. So new docs could be authored as .rst
it seems? Sphinx has good support for mixed file extensions / formats.
nessita — 10/22/24, 3:05 PM
I’m torn and terrified by having some with one extension, some with other extension
MY EYES MY EYES
I personally think it’s a bad idea to have a mixture of file extensions (txt and rst), because in that scenario, you have to explain why txt and WHY a little bit of both. To me is the worst of the two worlds.
nessita — 10/22/24, 3:16 PM
I would be open to consider a moving away from txt files but in that case I would advocate to migrate to markdown
so we do a proper disruptive thingy worth messing up with the history (but please note I’m not saying we should)
Baptiste — 10/22/24, 4:09 PM
Maybe host the documentation on Github wiki (sorry, that was a bad joke)
Marijke (Mah-Rye-Kuh) — 10/22/24, 4:37 PM
Was it a joke?
nessita — 10/22/24, 4:37 PM
since we are talking docs, am I missing something or these definitions for “attributes” inside class definition should have their description indented one level in? https://github.com/django/django/blame/main/docs/ref/contrib/gis/gdal.txt#L842 (cc/ @Mariusz Felisiak maybe you know how’s the correct indentation for these?)
Marijke (Mah-Rye-Kuh) — 10/22/24, 4:38 PM
I foresee the migration of the docs to Markdown files as Natalia’s Magnus Opus as a Fellow
nessita — 10/22/24, 4:38 PM
Please note that I wasn’t necessarily proposing that migration!
I said that IF we will consider the file extension rename, THEN we should do the whole mic drop properly
Marijke (Mah-Rye-Kuh) — 10/22/24, 4:39 PM
Just teasing you Although I wouldn’t be against it; I don’t like RST haha.
But yeah, if you do something drastic, better do it well the first time.
Baptiste — 10/22/24, 4:42 PM
You mean “should” as in “otherwise sphinx doesn’t parse them right”, or as in “according to Django’s styleguide”?
nessita — 10/22/24, 4:48 PM
Neither, as in “should to be semantically correct”
Ülgen — 10/22/24, 9:33 PM
Wouldn’t be more interesting than trac - github issues migration
Carlton Gibson — 10/23/24, 6:00 AM
Wowser that last 60 messages or so is quite painful