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

Re: [PATCH 1/5] git-submodule: New subcommand 'summary' (1) - code framework

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 12, 2008, 08:18 UTC
Message-ID
<7vmyrbv4ms.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<f67f45eeb9648bb7e5adaf53544443b79643914e.1200122041.git.pkufranky@gmail.com>
Ping Yin <pkufranky@gmail.com> writes:
Show 5 quoted lines
> +	# get modified modules which have been checked out (i.e. cared by user)
> +	modules=$(git diff $cache_option --raw $head -- "$@" |
> +		grep '^:160000\|:000000 160000' |
> +		while read mod_src mod_dst sha1_src sha1_dst status name
> +		do

You are listing paths that were already submodule in HEAD, or newly added submodule. What about a path that used to be a blob but is being made into submodule with the next commit (i.e. RHS is 160000 but LHS is not 000000)?

> +	# TODO: quote module names containing space or tab
Yes, you would need to worry about *un*quoting them.
> +	test -n "$modules" &&
> +	echo "# Submodules modified: "$modules &&
> +	echo "#"
> +	cd "$cwd"
Hmmmmmm.... 
Show 6 quoted lines
> -case "$add,$init,$update,$status,$cached" in
> -1,,,,)
> +case "$add,$init,$update,$summary,$status,$cached" in
> +1,,,,,)
>  	module_add "$@"
>  	;;
This is simply unsustainable.

Please see the other thread with Imran M Yousuf regarding the command dispatcher. I think that should be the first thing to fix before doing any change.

Previous: Ping YinNext: Ping Yin
Message 18 of 19 in “submodule summary support”
  1. 0/5 submodule summary supportPing Yin, Jan 12, 2008
  2. 1/5 git-submodule: New subcommand 'summary' (1) - code frameworkPing Yin, Jan 12, 2008
  3. 2/5 git-submodule: New subcommand 'summary' (2) - hard workPing Yin, Jan 12, 2008
  4. 3/5 git-submodule: New subcommand 'summary' (3) - limit summary sizePing Yin, Jan 12, 2008
  5. 4/5 git-status: submodule summary supportPing Yin, Jan 12, 2008
  6. 5/5 git-status: configurable submodule summary sizePing Yin, Jan 12, 2008
  7. Junio C HamanoJan 12, 2008
  8. Ping YinJan 12, 2008
  9. Junio C HamanoJan 12, 2008
  10. Ping YinJan 13, 2008
  11. Junio C HamanoJan 12, 2008
  12. Ping YinJan 12, 2008
  13. Ping YinJan 12, 2008
  14. Junio C HamanoJan 12, 2008
  15. Ping YinJan 12, 2008
  16. Junio C HamanoJan 12, 2008
  17. Ping YinJan 13, 2008
  18. Junio C HamanoJan 12, 2008
  19. Ping YinJan 12, 2008

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.