Re: [PATCH 2/3] builtins: utilize startup_info->help where possible

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

 



Nguyán ThÃi Ngác Duy wrote:

> It helps reduce false alarms while I'm looking for "git foo -h" code
> path that accesses repository.

Not sure I understand.  Is the idea that use of startup_info->help
is a marker for "I've checked this code path"?

If that were the only reason, I don't think I'd like the idea.

As it is, I'm a bit conflicted: what if we decide to short-circuit
"git foo --help-all" in the future just like we short-circuit
"git foo -h" now?  Would that require a separate flag?

In other words, I'm not sure startup_info->help is a good abstraction.
Maybe (modulo names) it would be better to do

struct startup_info {
	...
	const char *short_circuit;	/* "-h", "--help-all", "--no-index", or NULL */
};

and use

	if (!strcmp(startup_info->short_circuit, "-h"))

to allow relaxing the argc == 2 check later?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]