From: Junio C Hamano <gitster@pobox.com>
To: Ghanshyam Thakkar <shyamthakkar001@gmail.com>
Cc: git@vger.kernel.org, johannes.schindelin@gmx.de,
newren@gmail.com, christian.couder@gmail.com
Subject: Re: [PATCH] setup: clarify TODO comment about ignoring core.bare
Date: Thu, 29 Feb 2024 11:15:35 -0800 [thread overview]
Message-ID: <xmqqsf1bf5ew.fsf@gitster.g> (raw)
In-Reply-To: <20240229134114.285393-2-shyamthakkar001@gmail.com> (Ghanshyam Thakkar's message of "Thu, 29 Feb 2024 19:11:15 +0530")
Ghanshyam Thakkar <shyamthakkar001@gmail.com> writes:
> /*
> - * TODO: heed core.bare from config file in templates if no
> - * command-line override given
> + * Note: The below line simply checks the presence of worktree (the
> + * simplification of which is given after the line) and core.bare from
> + * config file is not taken into account when deciding if the worktree
> + * should be created or not, even if no command line override given.
> + * That is intentional. Therefore, if in future we want to heed
> + * core.bare from config file, we should do it before we create any
> + * subsequent directories for worktree or repo because until this point
> + * they should already be created.
> */
> is_bare_repository_cfg = prev_bare_repository || !work_tree;
I do not recall the discussion; others may want to discuss if the
change above is desirable, before I come back to the topic later.
But I see this long comment totally unnecessary and distracting.
> - /* TODO (continued):
> + /* Note (continued):
> *
> - * Unfortunately, the line above is equivalent to
> + * The line above is equivalent to
> * is_bare_repository_cfg = !work_tree;
> - * which ignores the config entirely even if no `--[no-]bare`
> - * command line option was present.
> *
> * To see why, note that before this function, there was this call:
> * prev_bare_repository = is_bare_repository()
If it can be proven that the assignment can be simplified to lose
the "prev_bare_repository ||" part, then the above comment can be
used as part of the proposed log message for a commit that makes
such a change. There is no reason to leave such a long comment to
leave the more complex "A || B" expression when it can be simplified
to "B", no?
Thanks.
next prev parent reply other threads:[~2024-02-29 19:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-02 22:07 [GSOC][RFC] Heed core.bare from template config file when no command line override given, as a microproject Ghanshyam Thakkar
2024-01-04 10:24 ` Christian Couder
2024-01-04 10:39 ` Ghanshyam Thakkar
2024-01-05 2:11 ` Elijah Newren
2024-01-05 15:59 ` Junio C Hamano
2024-01-06 12:07 ` Ghanshyam Thakkar
2024-01-08 17:32 ` Junio C Hamano
2024-01-19 1:43 ` Elijah Newren
2024-02-29 13:41 ` [PATCH] setup: clarify TODO comment about ignoring core.bare Ghanshyam Thakkar
2024-02-29 19:15 ` Junio C Hamano [this message]
2024-02-29 20:58 ` Ghanshyam Thakkar
2024-03-04 15:18 ` [PATCH v2] setup: remove unnecessary variable Ghanshyam Thakkar
2024-03-04 18:16 ` Junio C Hamano
2024-03-04 21:27 ` Ghanshyam Thakkar
2024-03-04 21:53 ` 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=xmqqsf1bf5ew.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=johannes.schindelin@gmx.de \
--cc=newren@gmail.com \
--cc=shyamthakkar001@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).