You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by era eriksson <er...@iki.fi> on 2007/12/19 09:20:56 UTC

[PATCH] Minor shell script syntax error in notes/svnsync.txt

I hope I am following the letter and spirit of the bug-reporting instructions
http://subversion.tigris.org/project_issues.html correctly here.

There is a minor quoting issue in the shell script in
http://svn.collab.net/repos/svn/trunk/notes/svnsync.txt which this patch
attempts to fix.  Basically, the backslash-escaping of shell variables in a
single-quoted here document is hypercorrect (fancy word for "wrong").  I suspect
the single quotes were added later without adjusting the rest of the script.

Do I still need to report this as a bug once somebody confirms, or is this
sufficient?

[[[
Fix shell script quoting error in svnsync pre-revprop-change example

* notes/svnsync.txt: no escaping of $ in single-quoted here document
]]]

Index: notes/svnsync.txt
===================================================================
--- notes/svnsync.txt	(revision 28552)
+++ notes/svnsync.txt	(working copy)
@@ -18,9 +18,9 @@
 
 $ cat <<'EOF' > dest/hooks/pre-revprop-change
 #!/bin/sh
-USER="\$3"
+USER="$3"
 
-if [ "\$USER" = "svnsync" ]; then exit 0; fi
+if [ "$USER" = "svnsync" ]; then exit 0; fi
 
 echo "Only the svnsync user can change revprops" >&2
 exit 1


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Minor shell script syntax error in notes/svnsync.txt

Posted by David Glasser <gl...@davidglasser.net>.
On Dec 19, 2007 1:20 AM, era eriksson <er...@iki.fi> wrote:
> I hope I am following the letter and spirit of the bug-reporting instructions
> http://subversion.tigris.org/project_issues.html correctly here.
>
> There is a minor quoting issue in the shell script in
> http://svn.collab.net/repos/svn/trunk/notes/svnsync.txt which this patch
> attempts to fix.  Basically, the backslash-escaping of shell variables in a
> single-quoted here document is hypercorrect (fancy word for "wrong").  I suspect
> the single quotes were added later without adjusting the rest of the script.
>
> Do I still need to report this as a bug once somebody confirms, or is this
> sufficient?

Heh.  So something like this (which is either "commit immediately or
never") isn't a big enough deal for an issue in the issue tracker.
Ironically this one already has an issue, though, #3033, which was the
patch you are recommending to revert.

Daniel, are you sure your patch was correct?

--dave

> [[[
> Fix shell script quoting error in svnsync pre-revprop-change example
>
> * notes/svnsync.txt: no escaping of $ in single-quoted here document
> ]]]
>
> Index: notes/svnsync.txt
> ===================================================================
> --- notes/svnsync.txt   (revision 28552)
> +++ notes/svnsync.txt   (working copy)
> @@ -18,9 +18,9 @@
>
>  $ cat <<'EOF' > dest/hooks/pre-revprop-change
>  #!/bin/sh
> -USER="\$3"
> +USER="$3"
>
> -if [ "\$USER" = "svnsync" ]; then exit 0; fi
> +if [ "$USER" = "svnsync" ]; then exit 0; fi
>
>  echo "Only the svnsync user can change revprops" >&2
>  exit 1
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>
>



-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org