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

Re: resolve (merge) problems

From
LTLuben Tuikov <ltuikov@yahoo.com>
Date
Dec 2, 2005, 01:50 UTC
Message-ID
<20051202015039.93047.qmail@web31811.mail.mud.yahoo.com>
In-Reply-To
<7vhd9sb9ie.fsf@assigned-by-dhcp.cox.net>
--- Junio C Hamano <junkio@cox.net> wrote:
> However, there is a bug recently introduced in the
> merge-one-file script.  

Ok, if your patch below resolves the bug (please see my other email just posted) please submit it. (I'm hitting this bug everytime there's a file deleted from the kernel tree and I try to merge.)

Thanks,
   Luben
Show 52 quoted lines
> 
> Although the conflict resolution procedure I described applies
> if you really had a real conflicting merge, I suspect your merge
> should not have failed in the first place.
> 
>         case "${1:-.}${2:-.}${3:-.}" in
>         #
>         # Deleted in both or deleted in one and unchanged in the other
>         #
>         "$1.." | "$1.$1" | "$1$1.")
>                 if [ "$2" ]; then
>                         echo "Removing $4"
>                 fi
>                 if test -f "$4"; then
>                         rm -f -- "$4" &&
>                         rmdir -p "$(expr "$4" : '\(.*\)/')" 2>/dev/null
>                 fi &&
>                         exec git-update-index --remove -- "$4"
>                 ;;
> 
> The faliure code from "rmdir -p" leaks up and makes
> git-update-index to be skipped.  Here is a fix.
> 
> -- >8 --
> [PATCH] merge-one-file fix
> 
> 9ae2172aed289f2706a0e88288909fa47eddd7e7 used "rmdir -p"
> carelessly, causing the "git-update-index --remove" to be
> skipped.
> 
> ---
> diff --git a/git-merge-one-file.sh b/git-merge-one-file.sh
> index 739a072..9a049f4 100755
> --- a/git-merge-one-file.sh
> +++ b/git-merge-one-file.sh
> @@ -26,7 +26,7 @@ case "${1:-.}${2:-.}${3:-.}" in
>  	fi
>  	if test -f "$4"; then
>  		rm -f -- "$4" &&
> -		rmdir -p "$(expr "$4" : '\(.*\)/')" 2>/dev/null
> +		rmdir -p "$(expr "$4" : '\(.*\)/')" 2>/dev/null || :
>  	fi &&
>  		exec git-update-index --remove -- "$4"
>  	;;
> 
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 11 in “resolve (merge) problems”
  1. Luben TuikovDec 1, 2005
  2. Junio C HamanoDec 1, 2005
  3. Luben TuikovDec 2, 2005
  4. Junio C HamanoDec 2, 2005
  5. Luben TuikovDec 2, 2005
  6. Junio C HamanoDec 2, 2005
  7. Luben TuikovDec 2, 2005
  8. Junio C HamanoDec 2, 2005
  9. Luben TuikovDec 2, 2005
  10. Linus TorvaldsDec 2, 2005
  11. Luben TuikovDec 2, 2005

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.