gnu-arch-users
[Top][All Lists]
Advanced

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

[Gnu-arch-users] Re: diff markers/ star merge


From: Anand Kumria
Subject: [Gnu-arch-users] Re: diff markers/ star merge
Date: Tue, 23 Nov 2004 01:42:02 +1100
User-agent: Pan/0.14.2.91 (As She Crawled Across the Table (Debian GNU/Linux))

On Mon, 22 Nov 2004 08:01:59 +1100, Zenaan Harkness wrote:

> Sorry to visit this again so soon, but I've been working for almost a
> month on a change and I want to merge, but I don't want to commit my
> change before I give it a solid review - which will take a good half day.
> 
> So, I can tla undo, tla star-merge then tla redo, except when I tla redo I
> get the .rej conflict files rather than diff3 in-file markers.
> 
> Is there a way to play with my branches to achieve this (get the diff3
> in-file markers when I re-do)?

This is only tangentially related but one of the guys at work found .rej
files obscure. He put together rej2diff, included below.

#!/bin/sh
# Vince Ho <address@hidden>
# Convert patch .rej rejects to proper diff format

# Convert to unified diffs by default
difftype="unified"

echo_diffhdr()
{
        local name="$1"

        # set the right context diff header stuff 
        prefix1="***"
        prefix2="---"
        [ -z "$name" ] && name="/dev/stdin"

        echo "$prefix1 $name"
        echo "$prefix2 $name-NEW"
}

# process options
while [ $# -gt 0 ]; do
        case $1 in
                -u|--unified)
                        difftype="unified"
                        shift
                        ;;
                -c|--context)
                        difftype="context"
                        shift
                        ;;
                *)
                        break
                        ;;
        esac
done

# If no arguments, run in filter mode
if [ $# -eq 0 ]; then
        (echo_diffhdr && cat) | filterdiff --format="$difftype"
else
        # Process each file
        while [ $# -gt 0 ]; do
                (echo_diffhdr ${1%.rej}; cat $1) | filterdiff --format="$difftyp
e"
                shift
        done
fi


HTH,
Anand





reply via email to

[Prev in Thread] Current Thread [Next in Thread]