Return-Path: X-Original-To: apmail-subversion-users-archive@minotaur.apache.org Delivered-To: apmail-subversion-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 025A91859D for ; Thu, 25 Jun 2015 08:11:55 +0000 (UTC) Received: (qmail 39720 invoked by uid 500); 25 Jun 2015 08:11:54 -0000 Delivered-To: apmail-subversion-users-archive@subversion.apache.org Received: (qmail 39683 invoked by uid 500); 25 Jun 2015 08:11:54 -0000 Mailing-List: contact users-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@subversion.apache.org Received: (qmail 39673 invoked by uid 99); 25 Jun 2015 08:11:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jun 2015 08:11:54 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW X-Spam-Check-By: apache.org Received-SPF: error (nike.apache.org: local policy) Received: from [209.85.218.47] (HELO mail-oi0-f47.google.com) (209.85.218.47) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jun 2015 08:09:40 +0000 Received: by oigx81 with SMTP id x81so47153965oig.1 for ; Thu, 25 Jun 2015 01:10:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=znujT3acEGS88/zng7ICIGR80DOpOvSSVpNZXWOp3Ys=; b=ZT5/Z7guuvei3eBkuQ812+Ak23fPiD2Ovs14e45p9sdv1BtO2tgEIV/7RxaemFJGBQ TCZbVOlB4Ww6S+4XAJ2kIAeZ36DFpSYAEar7sMk98cUjFffiLd/OUqxwv/BzqloZXvFp qjaIJP08tWiBg8jNF5da1PXcbGA00poh9fjqd6ICkzxdK26DTNdS2lxk5Lwec0Jxja3f kJnI6B6dGG1JDErkQDTHCG5ir23LuSTS1NCia+CUyZS6SLiawRsgx3uMpiWWXVuGBeG+ LHVpiVjPbeKhXzPRkltFmLH0M213MM9H31ke/dcAXlwb4DNSzJGPL1KGIeh9z6o714jy JDvw== X-Gm-Message-State: ALoCoQlSUEILzs7ofiOyxf9tB0ecO4x8cFoOeltr8T5o79YSvSLyZXT2+FZy58+0gugXE0pVzYm7 MIME-Version: 1.0 X-Received: by 10.60.34.104 with SMTP id y8mr38258138oei.77.1435219822113; Thu, 25 Jun 2015 01:10:22 -0700 (PDT) Received: by 10.202.171.199 with HTTP; Thu, 25 Jun 2015 01:10:22 -0700 (PDT) In-Reply-To: <558BB6B7.4060607@wandisco.com> References: <558BB6B7.4060607@wandisco.com> Date: Thu, 25 Jun 2015 13:40:22 +0530 Message-ID: Subject: Re: Facing issue in SVN pre commit hook | svnlook cat From: Dhiraj Prajapati To: =?UTF-8?Q?Branko_=C4=8Cibej?= Cc: users@subversion.apache.org Content-Type: multipart/alternative; boundary=089e013cc3d8ac0e4305195327d1 X-Virus-Checked: Checked by ClamAV on apache.org --089e013cc3d8ac0e4305195327d1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Below is the code snippet I am using. I need the file contents in a variable. *fileContents=3D`$SVNLOOK cat $REPOS $FNAME -t $TXN`* *echo "contents:" $fileContents 1>&2* Am I doing anything wrong? -Dhiraj On Thu, Jun 25, 2015 at 1:37 PM, Branko =C4=8Cibej wro= te: > On 25.06.2015 09:31, Dhiraj Prajapati wrote: > > Hi, > I have a pre-commit hook which validates the contents of the files being > committed before commit. > I am using *svnlook cat* command to read the contents of the file being > committed. > However, whenever there is a leading slash on a particular line in the > file, the *svnlook cat* command fails to display the slash. Instead it > prints the names of all the files/folders in the root directory. > > *Example file contents:* > > xyz > > /* > abc > > *Command:* > > svnlook cat -t > > *Output:* > > xyz /app /bin /boot /cdrom /dev /etc /home /lib > /lost+found /media /mnt /opt /proc /root /run /sbin /sources /srv /sys /t= mp > /usr /var /vmlinuz /vmlinuz.old abc > > I want* svnlook cat* to print exactly what is in the file. Please assist= . > > > This is "impossible" in the sense that 'svnlook cat' does not process the > contents in any way, it just prints them to stdout. > > You're probably piping the output of 'svnlook cat' into some kind of > program or script that validates them, and I suspect that script is > interpreting the contents so that it lists the directory contents as you > described. You should most likely look for the bug in your validation > script. > > -- Brane > --089e013cc3d8ac0e4305195327d1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Below is the code snippet I am using. I need the file= contents in a variable.

fileContents=3D`$SVNLOOK ca= t $REPOS $FNAME -t $TXN`
echo "contents:" $fileCon= tents 1>&2

Am I doing anything wron= g?

-Dhiraj
<= br>
On Thu, Jun 25, 2015 at 1:37 PM, Branko =C4= =8Cibej <brane@wandisco.com> wrote:
=20 =20 =20
On 25.06.2015 09:31, Dhiraj Prajapati wrote:
Hi,
I have a pre-commit hook which validates the contents of the files being committed before commit.
I am using svnlook cat command to read the contents of the file being committed.
However, whenever there is a leading slash on a particular line in the file, the svnlook cat command fails to display the slash. Instead it prints the names of all the files/folders in the root directory.

Example file contents:

xyz
<input name=3Dabc/>
/*
abc

Command:

svnlook cat <repository_path> <file_name> -t <txn>

Output:

xyz <input name=3Dabc/> /app /bin /boot /cdrom /dev /etc /home /lib /lost+found /media /mnt /opt /proc /root /run /sbin /sources /srv /sys /tmp /usr /var /vmlinuz /vmlinuz.old abc

I want svnlook cat to print exactly what is in the file. Please assist.

This is "impossible" in the sense that 'svnlook cat' = does not process the contents in any way, it just prints them to stdout.

You're probably piping the output of 'svnlook cat' into som= e kind of program or script that validates them, and I suspect that script is interpreting the contents so that it lists the directory contents as you described. You should most likely look for the bug in your validation script.

-- Brane

--089e013cc3d8ac0e4305195327d1--