Re: [TopGit PATCH] tg-patch: fix invocation in sub working tree directory

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

 



Hello again,

On Mon, Mar 16, 2009 at 11:08:19PM +0100, Bert Wesarg wrote:
> --- a/tg-patch.sh
> +++ b/tg-patch.sh
> @@ -50,13 +50,18 @@ cat_file "$topic:.topmsg"
>  echo
>  [ -n "$(git grep $diff_opts '^[-]--' ${diff_committed_only:+"$name"} -- ".topmsg")" ] || echo '---'
>  
> +# if we are in a sub working tree dir, we need to prefix all file names from
> +# git diff --name-only with this cdup
> +cdup=$(git rev-parse --show-cdup)
> +
>  # Evil obnoxious hack to work around the lack of git diff --exclude
>  git_is_stupid="$(mktemp -t tg-patch-changes.XXXXXX)"
>  git diff --name-only $diff_opts "$base_rev" ${diff_committed_only:+"$name"} -- |
>  	fgrep -vx ".topdeps" |
>  	fgrep -vx ".topmsg" >"$git_is_stupid" || : # fgrep likes to fail randomly?
>  if [ -s "$git_is_stupid" ]; then
> -	cat "$git_is_stupid" | xargs git diff --patch-with-stat $diff_opts "$base_rev" ${diff_committed_only:+"$name"} --
> +	sed -e "s#^#$cdup#" "$git_is_stupid" |
> +		xargs git diff --patch-with-stat $diff_opts "$base_rev" ${diff_committed_only:+"$name"} --
My not move pretty_tree from tg-export.sh to tg.sh and use that.
i.e.

	git diff $someopts "$(pretty_tree "$base_rev")" "$(pretty_tree "...")"

then we wouldn't need that git_is_stupid-hack and the relative path name
thinggy wouldn hurt us.

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |
--
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]

  Powered by Linux