You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Näslund <da...@longitudo.com> on 2010/07/23 14:06:09 UTC

A patch that erroneus causes a text conflict

Hi Stefan!

The patch below fails to apply. I'm investigating why.

Content of the file 'new':
-----------------------------
[[[
    #!/bin/sh
    IFS=@ read name address
    echo "A mail to $name at $address"
    read subject
    echo "Subject: $subject"

The script is fed its input through standard input. Calling this script in the
following manner (the > and $ are prompts)

    $ email <<EOT
    > matkin@docs.uu.se
    > Something strange @ my place
    > EOT

to a shell, will produce the output

    A mail to matkin at docs.uu.se
    Subject: Something strange @ my place
]]]

The patch:
-------------
[[[
Index: new
===================================================================
--- new	(revision 2)
+++ new	(arbetskopia)
@@ -4,12 +4,7 @@
     read subject
     echo "Subject: $subject"
 
-The script is fed its input through standard input. Calling this script in the
-following manner (the > and $ are prompts)
     > Something strange @ my place
     > EOT
 
-to a shell, will produce the output
 
-    A mail to matkin at docs.uu.se
-    Subject: Something strange @ my place
]]]

Output:
---------
  C         new
  >         rejected hunk @@ -4,12 +4,7 @@
  Summary of conflicts:

Thanks, 
Daniel

Re: A patch that erroneus causes a text conflict

Posted by Daniel Näslund <da...@longitudo.com>.
On Fri, Jul 23, 2010 at 04:13:44PM +0200, Stefan Sperling wrote:
> On Fri, Jul 23, 2010 at 04:06:09PM +0200, Daniel Näslund wrote:
> > Hi Stefan!
> > 
> > The patch below fails to apply. I'm investigating why.
> > 
> > Content of the file 'new':
> > -----------------------------
> > [[[
> >     #!/bin/sh
> >     IFS=@ read name address
> >     echo "A mail to $name at $address"
> >     read subject
> >     echo "Subject: $subject"
> > 
> > The script is fed its input through standard input. Calling this script in the
> > following manner (the > and $ are prompts)
> 
> Is the patch correct?
> 
> The following 3 lines are not in the patch:
> > 
> >     $ email <<EOT
> >     > matkin@docs.uu.se
> 
> 
> >     > Something strange @ my place
> >     > EOT
> > 

Hm, the patch was originally a diff for a property. It didn't apply
there so I changed the hunk headers and tried it against a file instead.
I assumed that the problem was in the patch code. When I made a fresh
diff against the file, it applied cleanly.

Here's a the original content for the prop and the file
[[[
$ svn pg added A/mu@BASE
    #!/bin/sh
    IFS=@ read name address
    echo "A mail to $name at $address"
    read subject
    echo "Subject: $subject"

The script is fed its input through standard input. Calling this script
in the
following manner (the > and $ are prompts)

    $ email <<EOT
    > matkin@docs.uu.se
    > Something strange @ my place
    > EOT

to a shell, will produce the output

    A mail to matkin at docs.uu.se
    Subject: Something strange @ my place


$ svn cat new@BASE
    #!/bin/sh
    IFS=@ read name address
    echo "A mail to $name at $address"
    read subject
    echo "Subject: $subject"

The script is fed its input through standard input. Calling this script
in the
following manner (the > and $ are prompts)

    $ email <<EOT
    > matkin@docs.uu.se
    > Something strange @ my place
    > EOT

to a shell, will produce the output

    A mail to matkin at docs.uu.se
    Subject: Something strange @ my place


]]]

They are the same when running diff(1) on them..

I've done the same changes but in the property case, the three lines you
pointed out as missing are indeed missing. Strange.

[[[
Index: A/mu
===================================================================
--- A/mu        (revision 3)
+++ A/mu        (arbetskopia)

Egenskapsändringar för: A/mu
___________________________________________________________________
Modified: added
## -4,12 +4,7 ##
     read subject
     echo "Subject: $subject"
 
-The script is fed its input through standard input. Calling this script
in the
-following manner (the > and $ are prompts)
     > Something strange @ my place
     > EOT
 
-to a shell, will produce the output
 
-    A mail to matkin at docs.uu.se
-    Subject: Something strange @ my place
Index: new
===================================================================
--- new (revision 3)
+++ new (arbetskopia)
@@ -4,16 +4,11 @@
     read subject
     echo "Subject: $subject"
 
-The script is fed its input through standard input. Calling this script
in the
-following manner (the > and $ are prompts)
 
     $ email <<EOT
     > matkin@docs.uu.se
     > Something strange @ my place
     > EOT
 
-to a shell, will produce the output
 
-    A mail to matkin at docs.uu.se
-    Subject: Something strange @ my place
]]]

Cheers,
Daniel

Re: A patch that erroneus causes a text conflict

Posted by Daniel Näslund <da...@longitudo.com>.
On Fri, Jul 23, 2010 at 04:13:44PM +0200, Stefan Sperling wrote:
> On Fri, Jul 23, 2010 at 04:06:09PM +0200, Daniel Näslund wrote:
> > Hi Stefan!
> > 
> > The patch below fails to apply. I'm investigating why.
> > 
> > Content of the file 'new':
> > -----------------------------
> > [[[
> >     #!/bin/sh
> >     IFS=@ read name address
> >     echo "A mail to $name at $address"
> >     read subject
> >     echo "Subject: $subject"
> > 
> > The script is fed its input through standard input. Calling this script in the
> > following manner (the > and $ are prompts)
> 
> Is the patch correct?
> 
> The following 3 lines are not in the patch:
> > 
> >     $ email <<EOT
> >     > matkin@docs.uu.se
> 
> 
> >     > Something strange @ my place
> >     > EOT
> > 

Hm, the patch was originally a diff for a property. It didn't apply
there so I changed the hunk headers and tried it against a file instead.
I assumed that the problem was in the patch code. When I made a fresh
diff against the file, it applied cleanly.

Here's a the original content for the prop and the file
[[[
$ svn pg added A/mu@BASE
    #!/bin/sh
    IFS=@ read name address
    echo "A mail to $name at $address"
    read subject
    echo "Subject: $subject"

The script is fed its input through standard input. Calling this script
in the
following manner (the > and $ are prompts)

    $ email <<EOT
    > matkin@docs.uu.se
    > Something strange @ my place
    > EOT

to a shell, will produce the output

    A mail to matkin at docs.uu.se
    Subject: Something strange @ my place


$ svn cat new@BASE
    #!/bin/sh
    IFS=@ read name address
    echo "A mail to $name at $address"
    read subject
    echo "Subject: $subject"

The script is fed its input through standard input. Calling this script
in the
following manner (the > and $ are prompts)

    $ email <<EOT
    > matkin@docs.uu.se
    > Something strange @ my place
    > EOT

to a shell, will produce the output

    A mail to matkin at docs.uu.se
    Subject: Something strange @ my place


]]]

They are the same when running diff(1) on them..

I've done the same changes but in the property case, the three lines you
pointed out as missing are indeed missing. Strange.

[[[
Index: A/mu
===================================================================
--- A/mu        (revision 3)
+++ A/mu        (arbetskopia)

Egenskapsändringar för: A/mu
___________________________________________________________________
Modified: added
## -4,12 +4,7 ##
     read subject
     echo "Subject: $subject"
 
-The script is fed its input through standard input. Calling this script
in the
-following manner (the > and $ are prompts)
     > Something strange @ my place
     > EOT
 
-to a shell, will produce the output
 
-    A mail to matkin at docs.uu.se
-    Subject: Something strange @ my place
Index: new
===================================================================
--- new (revision 3)
+++ new (arbetskopia)
@@ -4,16 +4,11 @@
     read subject
     echo "Subject: $subject"
 
-The script is fed its input through standard input. Calling this script
in the
-following manner (the > and $ are prompts)
 
     $ email <<EOT
     > matkin@docs.uu.se
     > Something strange @ my place
     > EOT
 
-to a shell, will produce the output
 
-    A mail to matkin at docs.uu.se
-    Subject: Something strange @ my place
]]]

Cheers,
Daniel