Re: [PATCH v3 3/3] git-merge-one-file: revise merge error reporting
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 13, 2013, 17:57 UTC
- Message-ID
- <7vehfj2neh.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1363137142-18606-3-git-send-email-kevin@bracey.fi>
Kevin Bracey <kevin@bracey.fi> writes:
Show 29 quoted lines
> Commit 718135e improved the merge error reporting for the resolve
> strategy's merge conflict and permission conflict cases, but led to a
> malformed "ERROR: in myfile.c" message in the case of a file added
> differently.
>
> This commit reverts that change, and uses an alternative approach without
> this flaw.
>
> Signed-off-by: Kevin Bracey <kevin@bracey.fi>
> ---
> git-merge-one-file.sh | 20 +++++++-------------
> 1 file changed, 7 insertions(+), 13 deletions(-)
>
> diff --git a/git-merge-one-file.sh b/git-merge-one-file.sh
> index 0f164e5..78b07a8 100755
> --- a/git-merge-one-file.sh
> +++ b/git-merge-one-file.sh
> @@ -104,11 +104,13 @@ case "${1:-.}${2:-.}${3:-.}" in
> ;;
> esac
>
> + ret=0
> src1=$(git-unpack-file $2)
> src2=$(git-unpack-file $3)
> case "$1" in
> '')
> - echo "Added $4 in both, but differently."
> + echo "ERROR: Added $4 in both, but differently."
> + ret=1The problem you identified may be worth fixing, but I do not think this change is correct.
This message is at the same severity level as the message on the other arm of this case that says "Auto-merging $4". In that other case arm, we are attempting a true three-way merge, and in this case arm, we are attempting a similar three-way merge using your "virtual base".
Neither has found any error in this case arm yet. The messages are both "informational", not an error. I do not think you would want to set ret=1 until you see content conflict.