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

Re: [PATCH 2/2] mergetool: Don't assume paths are unmerged

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 22, 2011, 21:33 UTC
Message-ID
<7v1uyl5z6v.fsf@alter.siamese.dyndns.org>
In-Reply-To
<92B6FB42-FE0D-48DC-ABD0-BA1903D842D2@JonathonMah.com>
Jonathon Mah <me@JonathonMah.com> writes:
Show 23 quoted lines
>  if test $# -eq 0 ; then
>      cd_to_toplevel
>  
>      if test -e "$GIT_DIR/MERGE_RR"
>      then
> +	files=$(git rerere remaining)
> +    else
> +	files=$(git ls-files -u | sed -e 's/^[^	]*	//' | sort -u)
>      fi
>  else
>      while test $# -gt 0; do
> +	matches=$(git ls-files -u -- "$1" | sed -e 's/^[^	]*	//' | sort -u)
> +	if test -n "$matches"; then
> +	    if test -z "$files"; then
> +		files=$matches
> +	    else
> +		files=$(printf "%s\n%s" "$files" "$matches")
> +	    fi
>  	fi
>  	shift
>      done
> +    files=$(printf "%s" "$files" | sort -u)
>  fi
Why do you need a loop here in the else clause, instead of just a single:
	files=$(git ls-files -u -- "$@" |...)
Previous: Junio C Hamano
Message 3 of 3 in “mergetool: Don't assume paths are unmerged”
  1. 2/2 mergetool: Don't assume paths are unmergedJonathon Mah, Jun 22, 2011
  2. Junio C HamanoJun 22, 2011
  3. Junio C HamanoJun 22, 2011

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.