public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Lidong Yan <yldhome2d2@gmail.com>
Cc: git@vger.kernel.org,  Lidong Yan <502024330056@smail.nju.edu.cn>,
	ayu.chandekar@gmail.com,  christian.couder@gmail.com,
	shyamthakkar001@gmail.com
Subject: Re: [RFC PATCH v3 0/2] small fixes for git.c and setup.c
Date: Sun, 15 Jun 2025 18:25:12 -0700	[thread overview]
Message-ID: <xmqqbjqo4gw7.fsf@gitster.g> (raw)
In-Reply-To: <20250615144604.1447302-1-502024330056@smail.nju.edu.cn> (Lidong Yan's message of "Sun, 15 Jun 2025 22:46:02 +0800")

Lidong Yan <yldhome2d2@gmail.com> writes:

> I've been reading through the git code from the beginning. This
> patch series fixes some NEEDSWORKs and cleans up some unnecessary
> uses of the_repository that I came across.

FYI, when we have "NEEDSWORK: do X", the intention is often "we
haven't spent enough brain cycles when we wrote this comment, so the
first step is to evaluate if doing X is a sensible thing in the
first place, and only if that is the case, do X".

> The first commit replace the use of the_repository to run_builtin()'s
> argument repo. Since each caller pass the_repository to run_builtin(),
> this replacement is safe.

That change is safe.  I'd rather see the comment left intact or
reverted to the original shape to clarify what code the comment
applies to (see the other message).

> The second commit takes care of a NEEDSWORK in setup_git_directory_gently()
> we now properly error out if we hit a .git that is not a file or directory
> when looking for the .git.

We used to just ignore and keep going to check the parent directory,
right?  Now we would error out when .git is a FIFO or device or any
other random things.  Is a bit of behaviour change, but I am not
sure if it is worth doing.  As finding these weird non-file things
in your working tree and naming them ".git" is extremely rare and
useless (from Git's point of view), I suspect that the user is
deliberately doing so for whatever reason they have, so it smells
like this change has very little chance to detect a real problem
with a larger chance to break a set-up that was deliberately done by
the end-user.  I dunno.

Thanks.



  parent reply	other threads:[~2025-06-16  1:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-12  4:59 [PATCH] git.c: remove the_repository dependence in run_builtin() Lidong Yan
2025-06-12 17:16 ` Junio C Hamano
2025-06-13  1:53   ` lidongyan
2025-06-13  4:49     ` Junio C Hamano
2025-06-14  5:03 ` [PATCH v2] " Lidong Yan
2025-06-14 23:35   ` Junio C Hamano
2025-06-15  1:49     ` Lidong Yan
2025-06-16  0:53       ` Junio C Hamano
2025-06-16  5:36         ` Lidong Yan
2025-06-16  5:41           ` Junio C Hamano
2025-06-15 14:46   ` [RFC PATCH v3 0/2] small fixes for git.c and setup.c Lidong Yan
2025-06-15 14:46     ` [PATCH v3 1/2] git.c: remove the_repository dependence in run_builtin() Lidong Yan
2025-06-15 14:46     ` [PATCH v3 2/2] setup: fix NEEDSWORK in setup_git_directory_gently() Lidong Yan
2025-06-16  1:25     ` Junio C Hamano [this message]
2025-06-16  1:36       ` [RFC PATCH v3 0/2] small fixes for git.c and setup.c Lidong Yan
2025-06-16  6:22     ` [PATCH v4] git.c: remove the_repository dependence in run_builtin() Lidong Yan

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=xmqqbjqo4gw7.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=502024330056@smail.nju.edu.cn \
    --cc=ayu.chandekar@gmail.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=shyamthakkar001@gmail.com \
    --cc=yldhome2d2@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