Re: [PATCH v2] git.c: remove the_repository dependence in run_builtin()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:
> e5b17bda (git: ensure correct git directory setup with -h,
> 2021-12-06) unfortunately moved lines around and made it look like
> the comment is about what happens when the if() condition holds, but
> if we look at the way how a9ca8a85 (builtins: print setup info if
> repo is found, 2010-11-26) initially placed this comment, we can see
> that this comment was to only explain the reason why we look at
> startup_info->have_repository there.  "Only if we know we have
> repository, do the trace_repo_setup() thing because that one calls
> get_git_dir() that would die otherwise" is what the comment wants to
> say, and if we revert the moving-line-around done by e5b17bda to
> recover the original layout in a9ca8a85, I think it is clear enough.

I’ve changed my mind. Layout like

	if (run_setup &&
		startup_info->have_repository) /* get_git_dir() may set up repo, avoid that */
		trace_repo_setup(repo);

Looks unbalanced, and git-clang-format tries to format this code
snippet into

	if (run_setup && startup_info->have_repository) /* get_git_dir() may set
							   up repo, avoid that
							 */

Which looks even worse, I will leave this comment intact.

Thanks,
Lidong






[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux