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

Re: [PATCH] t1300: document some aesthetic failures of the config editor

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 29, 2013, 20:00 UTC
Message-ID
<7vd2uinfhc.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vobe2nins.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 5 quoted lines
> ...  If we _were_ to remove the section header at this point,
> we should be removing the comment two out of three cases (if it is
> about section.key, it should go when section.key goes; if it is
> about section, it should go when section goes; if it is a more
> generic comment about this configuration file, it should stay).
The last case should end more like this:
	..., it should stay, but why are you writing a comment that
	is not specific to this section _inside_ the section in the
	first place???

Another case we have to worry about, if we were to remove an empty section header is this case:

	# Now, let's list all the remotes I interact with.
        # This is where I push all the separate topics.
        [remote "github"]
		# fetch like everybody else without auth
		url = git://github.com/user/git
		# push with auth
                pushURL = github.com:user/git
		# publish the state of my primary working area as-is
                mirror
	# Traditional "canonical" one
	[remote "korg"]
        	url = k.org:/pub/scm/user/git

If I were to retire "github" account, removing the section while keeping the comments would be confusing (I do not push all the separate topics to korg). Removing the section while removing the comments that pertain to the section is impossible; "Now, let's list all the remotes" should stay, "This is where I push" should go.

Removing only the keys and keeping the skelton around would give us:
	# Now, let's list all the remotes I interact with.
        # This is where I push all the separate topics.
        [remote "github"]
		# fetch like everybody else without auth
		# push with auth
		# publish the state of my primary working area as-is
	# Traditional "canonical" one
	[remote "korg"]
        	url = k.org:/pub/scm/user/git

which is still confusing, but at least the confusion is not spread to adjacent sections.

Previous: Jeff KingNext: Junio C Hamano
Message 12 of 13 in “Minor bug in git branch --set-upstream-to adding superfluous branch section to config”
  1. Phil HaackMar 29, 2013
  2. Jeff KingMar 29, 2013
  3. Thomas RastMar 29, 2013
  4. Jeff KingMar 29, 2013
  5. t1300: document some aesthetic failures of the config editorJeff King, Mar 29, 2013
  6. Junio C HamanoMar 29, 2013
  7. Jeff KingMar 29, 2013
  8. Junio C HamanoMar 29, 2013
  9. Jeff KingMar 30, 2013
  10. Johannes SchindelinMar 28, 2018
  11. Jeff KingMar 28, 2018
  12. Junio C HamanoMar 29, 2013
  13. Junio C HamanoMar 29, 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.