* Re: [PATCH] shortlog: Fix wrapping lines of wraplen
From: Junio C Hamano @ 2012-12-09 9:36 UTC (permalink / raw)
To: Steffen Prohaska; +Cc: git, Jan H. Schoenherr
In-Reply-To: <1354993767-7455-1-git-send-email-prohaska@zib.de>
Steffen Prohaska <prohaska@zib.de> writes:
> A recent commit [1] fixed a off-by-one wrapping error. As
> a side-effect, add_wrapped_shortlog_msg() needs to be changed to always
> append a newline.
Could you clarify "As a side effect" a bit more? Do you mean
something like this?
Earlier strbuf_add_wrapped_text() ended its output with a
newline only when the end of the text exactly fitted in wrap
length, due to the off-by-one error fixed with 14e1a4e (utf8:
fix off-by-one wrapping of text, 2012-10-18). There was a hack
in add_wrapped_shortlog_msg() function to compensate for this
bug.
With the bug fixed, the function never ends its output with a
newline, and the caller needs to unconditionally add one.
>
> [1] 14e1a4e1ff70aff36db3f5d2a8b806efd0134d50 utf8: fix off-by-one
> wrapping of text
>
> Signed-off-by: Steffen Prohaska <prohaska@zib.de>
> ---
> builtin/shortlog.c | 3 +--
> t/t4201-shortlog.sh | 24 ++++++++++++++++++++++++
> 2 files changed, 25 insertions(+), 2 deletions(-)
>
> diff --git a/builtin/shortlog.c b/builtin/shortlog.c
> index b316cf3..db5b57d 100644
> --- a/builtin/shortlog.c
> +++ b/builtin/shortlog.c
> @@ -307,8 +307,7 @@ static void add_wrapped_shortlog_msg(struct strbuf *sb, const char *s,
> const struct shortlog *log)
> {
> int col = strbuf_add_wrapped_text(sb, s, log->in1, log->in2, log->wrap);
> - if (col != log->wrap)
> - strbuf_addch(sb, '\n');
> + strbuf_addch(sb, '\n');
> }
>
> void shortlog_output(struct shortlog *log)
> diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh
> index 6872ba1..02ac978 100755
> --- a/t/t4201-shortlog.sh
> +++ b/t/t4201-shortlog.sh
> @@ -120,6 +120,30 @@ test_expect_success 'shortlog from non-git directory' '
> test_cmp expect out
> '
>
> +test_expect_success 'shortlog should add newline when input line matches wraplen' '
> + cat >expect <<\EOF &&
> +A U Thor (2):
> + bbbbbbbbbbbbbbbbbb: bbbbbbbb bbb bbbb bbbbbbb bb bbbb bbb bbbbb bbbbbb
> + aaaaaaaaaaaaaaaaaaaaaa: aaaaaa aaaaaaaaaa aaaa aaaaaaaa aa aaaa aa aaa
> +
> +EOF
> + git shortlog -w >out <<\EOF &&
> +commit 0000000000000000000000000000000000000001
> +Author: A U Thor <author@example.com>
> +Date: Thu Apr 7 15:14:13 2005 -0700
> +
> + aaaaaaaaaaaaaaaaaaaaaa: aaaaaa aaaaaaaaaa aaaa aaaaaaaa aa aaaa aa aaa
> +
> +commit 0000000000000000000000000000000000000002
> +Author: A U Thor <author@example.com>
> +Date: Thu Apr 7 15:14:13 2005 -0700
> +
> + bbbbbbbbbbbbbbbbbb: bbbbbbbb bbb bbbb bbbbbbb bb bbbb bbb bbbbb bbbbbb
> +
> +EOF
> + test_cmp expect out
> +'
> +
> iconvfromutf8toiso88591() {
> printf "%s" "$*" | iconv -f UTF-8 -t ISO8859-1
> }
^ permalink raw reply
* Re: [PATCH] gitk: read and write a repository specific configuration file
From: Junio C Hamano @ 2012-12-09 9:18 UTC (permalink / raw)
To: Łukasz Stelmach; +Cc: git, mbranchaud, paulus
In-Reply-To: <1354966067-2865-1-git-send-email-stlman@poczta.fm>
Łukasz Stelmach <stlman@poczta.fm> writes:
> Enable gitk read and write repository specific configuration
> file: ".git/k" if the file exists. To make gitk use the local
> file simply create one, e.g. with the touch(1) command.
>
> This is very useful if one uses different views for different
> repositories. Now there is no need to store all of them in
> ~/.gitk and make the views list needlessly long.
I do not use gitk heavily myself, but I have a mixed feeling about
this patch.
Forking the configuration from the one true ~/.gitk is easy; it is
just the matter of copying it to repository specific location. Once
forked, however, it is very hard to merge these configuration files
sprinkled across repositories back, or more importantly, change the
settings globally. Imagine you just got a new monitor that is a lot
finer grained than the one you have been usingq, and your choice of
font size has been specified in terms of pixels; you would want to
show all gitk windows in larger font now, regardless of the
repository, but you now have to go to 47 different configuration
files and update them.
So I suspect that this may introduce more trouble than it is worth
for users and should not be sold with a "This is very useful" label.
At best, it is "This may be useful"; otherwise the feature may end
up harming our users. I'd phrase it without judging if it is good
or bad for the users, perhaps like this:
This allows one to specify different views for different
repositories.
In any case, the filename .git/k may be _cute_, but I do not think
we would want to see:
$ ls .git
branches config HEAD index k objects
COMMIT_EDITMSG description hooks info logs refs
It is too cryptic, unless the user _knows_ 'k' is for gitk. I'd
call it $GIT_DIR/gitkconfig or something, if I were supportive for
this feature (which I am not enthusiastic, yet).
Thanks.
^ permalink raw reply
* Re: Feature Request - Hide ignored files before checkout
From: Junio C Hamano @ 2012-12-09 9:04 UTC (permalink / raw)
To: Chris Rorvick; +Cc: Matthew Ciancio, git
In-Reply-To: <CAEUsAPaHJ+N0EnxGuVkRqcmY0fUy+4myMiWtd1_vu1vRL763JQ@mail.gmail.com>
Chris Rorvick <chris@rorvick.com> writes:
> It's not in branchA, it's just no longer ignored because your changes
> to .gitignore were effectively reverted by jumping back to the commit
> that branchA points to.
> ...
> "hide/reappear" is the equivalent to saying "deleted/created" in the
> case of a tracked file in your working tree. But how would Git cause
> an untracked file to reappear? By definition, it doesn't know
> anything about the file.
Nicely explained. To make something simply disappear, you could
remove it, but that is obviously not enough to make it reappear. It
has to be stashed away somewhere before it gets removed, and in the
context of (any) SCM, that is done by committing.
You may have Mac and Windows branches, each of which needs to link
with vendor supplied object file blackbox.o with the rest of the
source. It is understandable if a project does not want to mix such
platform specific black box binaries in the history of the source.
But that does not necessarily mean the project can totally ignore
what specific black box binary was meant to be used with the rest of
the source.
After you released the v1.0 of your product for both Macintosh and
Windows, the vendor may supply updated versions of the blackbox.o
binary for these platforms, and you would start working toward v1.1
of your product using these updated copies of objects. Then you
find problems in the released v1.0 software. Without keeping track
of which version of the object was used to build the released v1.0,
you cannot diagnose, build and test a maintenance update v1.0.1.
The project may add new Macintosh (or Windows) developers. You can
tell new Macintosh developers to clone and checkout mac branch, and
in the same e-mail, give them the untracked blackbox.o file for that
platform, but you have to rely on human not making mistakes (you may
mistakenly send Windows version of blackbox.o to him, you may send
stale Macintosh version, the developer may misplace the new one and
keep using the stale one, etc. etc.).
Some people commit blackbox.o on each platform-specific branch, or
all branches share blackbox-win.o and blackbox-mac.o, only one of
which is used at any given branch, for this exact reason.
The project, for licensing reasons, may not have rights to
distribute such a blackbox object file along with its sources, but
the vendor of the blackbox object may allow individual developer to
download and link it from vendor's site. In such a case, the
project would not want to (and is not allowed to) commit such object
file. One approach I have seen used in such a case is to arrange
the build procedure so that these individual developers can drop
such an external object next to the project directory, and refer to
it as ../blackbox.o when linking.
So "these files are moved away from the working tree upon checking
another branch out, and moved back into the working tree upon
checking out this branch" is pretty much outside the scope of any
SCM. It is not very interesting, as it is not necessary to solve
any real world problem.
Of course, the users can do whatever moving/copying/renaming of
untracked files in their post-checkout hook to be run when a new
branch is checked out.
^ permalink raw reply
* RE: Feature Request - Hide ignored files before checkout
From: Matthew Ciancio @ 2012-12-09 8:10 UTC (permalink / raw)
To: 'Chris Rorvick'; +Cc: git
In-Reply-To: <CAEUsAPaqSQVSNaiJUO3Sfms3Rt2vzsciczXK0impHnXQ52u7mA@mail.gmail.com>
I'm glad we are on the same page now and thanks for bringing in others.
" Not wanting the files in the repository seems to be in conflict with the
desire to have them under its control (i.e., disappear/reappear behavior.) "
Sorry, when I said I didn't want them in the repository, I meant I wanted
them there (in the repository folder), but not within Git commit logs and
not being tracked, etc.
Committing binary/OS specific files just doesn't sit right with me and I am
sure many others.
"... but why do you need them to disappear? Why not just put them somewhere
where they can be used when needed and left alone when not?"
I could do that (keep them in a folder that will be left alone), but in my
specific case it would mean the executable files (ignored files placed in
this new folder) will not execute because of the change in location and
hence would require a lot of code change to suit.
>From my perspective I don't see the harm in having this as a new feature
(via flags in the .gitignore file, if you don't want to make it default
behaviour). Is there some reason I don't know about, maybe to do with the
Git source code?
-----Original Message-----
From: chris.rorvick@gmail.com [mailto:chris.rorvick@gmail.com] On Behalf Of
Chris Rorvick
Sent: Sunday, 9 December 2012 4:54 PM
To: Matthew Ciancio
Cc: git@vger.kernel.org
Subject: Re: Feature Request - Hide ignored files before checkout
On Sat, Dec 8, 2012 at 6:06 PM, Matthew Ciancio
<matthew.ciancio16@gmail.com> wrote:
> Hi Chris,
>
> Yes, I don't think I have explained myself well enough.
>
> When I say "disappear" I do not mean "get deleted", I mean: go out of
> view just like foo.txt does, as it is committed to branchB and not
> merged into branchA.
>
> So I am saying that I think .gitignored files should behave partly
> like committed and un-merged files, in the sense that they disappear
> when checking out to a different branch.
> I don't want to commit these files (which would give me the behaviour
> I want), because they are binary/OS specific and really do not belong
> in the repository, BUT I need them to run/build certain committed files.
>
> To be concrete: I want ignore.txt to be ignored in branchB and hence
> disappear (in the same way that foo.txt will), when checking out to
branchA.
> When I checkout back to branchB I want ignore.txt to reappear (in the
> same way that foo.txt will).
>
> I understand why this behaviour is not happening (because my
> .gitignore files are different between the branches), but I am saying
> that I would like to have the option to keep my .gitignore'd files
> local to the branch they are in.
>
> E.g. I currently have a branch with all these binary files that are
> required to run an application on my OS, but when I checkout to
> another branch I do not need or want those binary files anymore (at
> least not until I checkout back into the branch I just came from).
>
> Please tell me if that still doesn't make sense.
Hi Matthew,
Cc'ing the list to benefit from the review of others.
Not wanting the files in the repository seems to be in conflict with the
desire to have them under its control (i.e., disappear/reappear
behavior.) I understand not wanting to commit dependencies, but why do you
need them to disappear? Why not just put them somewhere where they can be
used when needed and left alone when not?
If you do want this behavior, it seems like you should just commit the files
on the respective branch. Maybe someone else will have a better idea,
though.
Chris
^ permalink raw reply
* Re: Feature Request - Hide ignored files before checkout
From: Chris Rorvick @ 2012-12-09 5:54 UTC (permalink / raw)
To: Matthew Ciancio; +Cc: git
In-Reply-To: <000001cdd5a0$fd23adf0$f76b09d0$@gmail.com>
On Sat, Dec 8, 2012 at 6:06 PM, Matthew Ciancio
<matthew.ciancio16@gmail.com> wrote:
> Hi Chris,
>
> Yes, I don't think I have explained myself well enough.
>
> When I say "disappear" I do not mean "get deleted", I mean: go out of view
> just like foo.txt does, as it is committed to branchB and not merged into
> branchA.
>
> So I am saying that I think .gitignored files should behave partly like
> committed and un-merged files, in the sense that they disappear when
> checking out to a different branch.
> I don't want to commit these files (which would give me the behaviour I
> want), because they are binary/OS specific and really do not belong in the
> repository, BUT I need them to run/build certain committed files.
>
> To be concrete: I want ignore.txt to be ignored in branchB and hence
> disappear (in the same way that foo.txt will), when checking out to branchA.
> When I checkout back to branchB I want ignore.txt to reappear (in the same
> way that foo.txt will).
>
> I understand why this behaviour is not happening (because my .gitignore
> files are different between the branches), but I am saying that I would like
> to have the option to keep my .gitignore'd files local to the branch they
> are in.
>
> E.g. I currently have a branch with all these binary files that are required
> to run an application on my OS, but when I checkout to another branch I do
> not need or want those binary files anymore (at least not until I checkout
> back into the branch I just came from).
>
> Please tell me if that still doesn't make sense.
Hi Matthew,
Cc'ing the list to benefit from the review of others.
Not wanting the files in the repository seems to be in conflict with
the desire to have them under its control (i.e., disappear/reappear
behavior.) I understand not wanting to commit dependencies, but why
do you need them to disappear? Why not just put them somewhere where
they can be used when needed and left alone when not?
If you do want this behavior, it seems like you should just commit the
files on the respective branch. Maybe someone else will have a better
idea, though.
Chris
^ permalink raw reply
* [PATCH 8/8] t9402: Use TABs for indentation
From: Torsten Bögershausen @ 2012-12-08 21:35 UTC (permalink / raw)
To: git; +Cc: tboegi, mmogilvi_git
Use TAB's for indentation
Put the closing ' at the begin of the line
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
t/t9402-git-cvsserver-refs.sh | 746 +++++++++++++++++++++---------------------
1 file changed, 373 insertions(+), 373 deletions(-)
diff --git a/t/t9402-git-cvsserver-refs.sh b/t/t9402-git-cvsserver-refs.sh
index 8dc4848..8363dc0 100755
--- a/t/t9402-git-cvsserver-refs.sh
+++ b/t/t9402-git-cvsserver-refs.sh
@@ -10,56 +10,56 @@ tags, branches and other git refspecs'
#########
check_start_tree() {
- rm -f "$WORKDIR/list.expected"
- echo "start $1" >>"${WORKDIR}/check.log"
+ rm -f "$WORKDIR/list.expected"
+ echo "start $1" >>"${WORKDIR}/check.log"
}
check_file() {
- sandbox="$1"
- file="$2"
- ver="$3"
- GIT_DIR=$SERVERDIR git show "${ver}:${file}" \
- >"$WORKDIR/check.got" 2>"$WORKDIR/check.stderr"
- test_cmp "$WORKDIR/check.got" "$sandbox/$file"
- stat=$?
- echo "check_file $sandbox $file $ver : $stat" >>"$WORKDIR/check.log"
- echo "$file" >>"$WORKDIR/list.expected"
- return $stat
+ sandbox="$1"
+ file="$2"
+ ver="$3"
+ GIT_DIR=$SERVERDIR git show "${ver}:${file}" \
+ >"$WORKDIR/check.got" 2>"$WORKDIR/check.stderr"
+ test_cmp "$WORKDIR/check.got" "$sandbox/$file"
+ stat=$?
+ echo "check_file $sandbox $file $ver : $stat" >>"$WORKDIR/check.log"
+ echo "$file" >>"$WORKDIR/list.expected"
+ return $stat
}
check_end_tree() {
- sandbox="$1" &&
- find "$sandbox" -name CVS -prune -o -type f -print >"$WORKDIR/list.actual" &&
- sort <"$WORKDIR/list.expected" >expected &&
- sort <"$WORKDIR/list.actual" | sed -e "s%cvswork/%%" >actual &&
- test_cmp expected actual &&
- rm expected actual
+ sandbox="$1" &&
+ find "$sandbox" -name CVS -prune -o -type f -print >"$WORKDIR/list.actual" &&
+ sort <"$WORKDIR/list.expected" >expected &&
+ sort <"$WORKDIR/list.actual" | sed -e "s%cvswork/%%" >actual &&
+ test_cmp expected actual &&
+ rm expected actual
}
check_end_full_tree() {
- sandbox="$1" &&
- sort <"$WORKDIR/list.expected" >expected &&
- find "$sandbox" -name CVS -prune -o -type f -print | sed -e "s%$sandbox/%%" | sort >act1 &&
- test_cmp expected act1 &&
- git ls-tree --name-only -r "$2" | sort >act2 &&
- test_cmp expected act2 &&
- rm expected act1 act2
+ sandbox="$1" &&
+ sort <"$WORKDIR/list.expected" >expected &&
+ find "$sandbox" -name CVS -prune -o -type f -print | sed -e "s%$sandbox/%%" | sort >act1 &&
+ test_cmp expected act1 &&
+ git ls-tree --name-only -r "$2" | sort >act2 &&
+ test_cmp expected act2 &&
+ rm expected act1 act2
}
#########
check_diff() {
- diffFile="$1"
- vOld="$2"
- vNew="$3"
- rm -rf diffSandbox
- git clone -q -n . diffSandbox &&
- (
- cd diffSandbox &&
- git checkout "$vOld" &&
- git apply -p0 --index <"../$diffFile" &&
- git diff --exit-code "$vNew"
- ) >check_diff_apply.out 2>&1
+ diffFile="$1"
+ vOld="$2"
+ vNew="$3"
+ rm -rf diffSandbox
+ git clone -q -n . diffSandbox &&
+ (
+ cd diffSandbox &&
+ git checkout "$vOld" &&
+ git apply -p0 --index <"../$diffFile" &&
+ git diff --exit-code "$vNew"
+ ) >check_diff_apply.out 2>&1
}
#########
@@ -67,17 +67,17 @@ check_diff() {
cvs >/dev/null 2>&1
if test $? -ne 1
then
- skip_all='skipping git-cvsserver tests, cvs not found'
- test_done
+ skip_all='skipping git-cvsserver tests, cvs not found'
+ test_done
fi
if ! test_have_prereq PERL
then
- skip_all='skipping git-cvsserver tests, perl not available'
- test_done
+ skip_all='skipping git-cvsserver tests, perl not available'
+ test_done
fi
"$PERL_PATH" -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
- skip_all='skipping git-cvsserver tests, Perl SQLite interface unavailable'
- test_done
+ skip_all='skipping git-cvsserver tests, Perl SQLite interface unavailable'
+ test_done
}
unset GIT_DIR GIT_CONFIG
@@ -91,414 +91,414 @@ export CVSROOT CVS_SERVER
rm -rf "$CVSWORK" "$SERVERDIR"
test_expect_success 'setup v1, b1' '
- echo "Simple text file" >textfile.c &&
- echo "t2" >t2 &&
- mkdir adir &&
- echo "adir/afile line1" >adir/afile &&
- echo "adir/afile line2" >>adir/afile &&
- echo "adir/afile line3" >>adir/afile &&
- echo "adir/afile line4" >>adir/afile &&
- echo "adir/a2file" >>adir/a2file &&
- mkdir adir/bdir &&
- echo "adir/bdir/bfile line 1" >adir/bdir/bfile &&
- echo "adir/bdir/bfile line 2" >>adir/bdir/bfile &&
- echo "adir/bdir/b2file" >adir/bdir/b2file &&
- git add textfile.c t2 adir &&
- git commit -q -m "First Commit (v1)" &&
- git tag v1 &&
- git branch b1 &&
- git clone -q --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
- GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
- GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log"
+ echo "Simple text file" >textfile.c &&
+ echo "t2" >t2 &&
+ mkdir adir &&
+ echo "adir/afile line1" >adir/afile &&
+ echo "adir/afile line2" >>adir/afile &&
+ echo "adir/afile line3" >>adir/afile &&
+ echo "adir/afile line4" >>adir/afile &&
+ echo "adir/a2file" >>adir/a2file &&
+ mkdir adir/bdir &&
+ echo "adir/bdir/bfile line 1" >adir/bdir/bfile &&
+ echo "adir/bdir/bfile line 2" >>adir/bdir/bfile &&
+ echo "adir/bdir/b2file" >adir/bdir/b2file &&
+ git add textfile.c t2 adir &&
+ git commit -q -m "First Commit (v1)" &&
+ git tag v1 &&
+ git branch b1 &&
+ git clone -q --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
+ GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
+ GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log"
'
rm -rf cvswork
test_expect_success 'cvs co v1' '
- cvs -f -Q co -r v1 -d cvswork master >cvs.log 2>&1 &&
- check_start_tree cvswork &&
- check_file cvswork textfile.c v1 &&
- check_file cvswork t2 v1 &&
- check_file cvswork adir/afile v1 &&
- check_file cvswork adir/a2file v1 &&
- check_file cvswork adir/bdir/bfile v1 &&
- check_file cvswork adir/bdir/b2file v1 &&
- check_end_tree cvswork
+ cvs -f -Q co -r v1 -d cvswork master >cvs.log 2>&1 &&
+ check_start_tree cvswork &&
+ check_file cvswork textfile.c v1 &&
+ check_file cvswork t2 v1 &&
+ check_file cvswork adir/afile v1 &&
+ check_file cvswork adir/a2file v1 &&
+ check_file cvswork adir/bdir/bfile v1 &&
+ check_file cvswork adir/bdir/b2file v1 &&
+ check_end_tree cvswork
'
rm -rf cvswork
test_expect_success 'cvs co b1' '
- cvs -f co -r b1 -d cvswork master >cvs.log 2>&1 &&
- check_start_tree cvswork &&
- check_file cvswork textfile.c v1 &&
- check_file cvswork t2 v1 &&
- check_file cvswork adir/afile v1 &&
- check_file cvswork adir/a2file v1 &&
- check_file cvswork adir/bdir/bfile v1 &&
- check_file cvswork adir/bdir/b2file v1 &&
- check_end_tree cvswork
+ cvs -f co -r b1 -d cvswork master >cvs.log 2>&1 &&
+ check_start_tree cvswork &&
+ check_file cvswork textfile.c v1 &&
+ check_file cvswork t2 v1 &&
+ check_file cvswork adir/afile v1 &&
+ check_file cvswork adir/a2file v1 &&
+ check_file cvswork adir/bdir/bfile v1 &&
+ check_file cvswork adir/bdir/b2file v1 &&
+ check_end_tree cvswork
'
test_expect_success 'cvs co b1 [cvswork3]' '
- cvs -f co -r b1 -d cvswork3 master >cvs.log 2>&1 &&
- check_start_tree cvswork3 &&
- check_file cvswork3 textfile.c v1 &&
- check_file cvswork3 t2 v1 &&
- check_file cvswork3 adir/afile v1 &&
- check_file cvswork3 adir/a2file v1 &&
- check_file cvswork3 adir/bdir/bfile v1 &&
- check_file cvswork3 adir/bdir/b2file v1 &&
- check_end_full_tree cvswork3 v1
+ cvs -f co -r b1 -d cvswork3 master >cvs.log 2>&1 &&
+ check_start_tree cvswork3 &&
+ check_file cvswork3 textfile.c v1 &&
+ check_file cvswork3 t2 v1 &&
+ check_file cvswork3 adir/afile v1 &&
+ check_file cvswork3 adir/a2file v1 &&
+ check_file cvswork3 adir/bdir/bfile v1 &&
+ check_file cvswork3 adir/bdir/b2file v1 &&
+ check_end_full_tree cvswork3 v1
'
test_expect_success 'edit cvswork3 and save diff' '
- (
- cd cvswork3 &&
- sed -e "s/line1/line1 - data/" adir/afile >adir/afileNEW &&
+ (
+ cd cvswork3 &&
+ sed -e "s/line1/line1 - data/" adir/afile >adir/afileNEW &&
mv -f adir/afileNEW adir/afile &&
- echo "afile5" >adir/afile5 &&
- rm t2 &&
- cvs -f add adir/afile5 &&
- cvs -f rm t2 &&
- ! cvs -f diff -N -u >"$WORKDIR/cvswork3edit.diff"
- )
+ echo "afile5" >adir/afile5 &&
+ rm t2 &&
+ cvs -f add adir/afile5 &&
+ cvs -f rm t2 &&
+ ! cvs -f diff -N -u >"$WORKDIR/cvswork3edit.diff"
+ )
'
test_expect_success 'setup v1.2 on b1' '
- git checkout b1 &&
- echo "new v1.2" >t3 &&
- rm t2 &&
- sed -e "s/line3/line3 - more data/" adir/afile >adir/afileNEW &&
+ git checkout b1 &&
+ echo "new v1.2" >t3 &&
+ rm t2 &&
+ sed -e "s/line3/line3 - more data/" adir/afile >adir/afileNEW &&
mv -f adir/afileNEW adir/afile &&
- rm adir/a2file &&
- echo "a3file" >>adir/a3file &&
- echo "bfile line 3" >>adir/bdir/bfile &&
- rm adir/bdir/b2file &&
- echo "b3file" >adir/bdir/b3file &&
- mkdir cdir &&
- echo "cdir/cfile" >cdir/cfile &&
- git add -A cdir adir t3 t2 &&
- git commit -q -m 'v1.2' &&
- git tag v1.2 &&
- git push --tags gitcvs.git b1:b1
+ rm adir/a2file &&
+ echo "a3file" >>adir/a3file &&
+ echo "bfile line 3" >>adir/bdir/bfile &&
+ rm adir/bdir/b2file &&
+ echo "b3file" >adir/bdir/b3file &&
+ mkdir cdir &&
+ echo "cdir/cfile" >cdir/cfile &&
+ git add -A cdir adir t3 t2 &&
+ git commit -q -m 'v1.2' &&
+ git tag v1.2 &&
+ git push --tags gitcvs.git b1:b1
'
test_expect_success 'cvs -f up (on b1 adir)' '
- ( cd cvswork/adir && cvs -f up -d ) >cvs.log 2>&1 &&
- check_start_tree cvswork &&
- check_file cvswork textfile.c v1 &&
- check_file cvswork t2 v1 &&
- check_file cvswork adir/afile v1.2 &&
- check_file cvswork adir/a3file v1.2 &&
- check_file cvswork adir/bdir/bfile v1.2 &&
- check_file cvswork adir/bdir/b3file v1.2 &&
- check_end_tree cvswork
+ ( cd cvswork/adir && cvs -f up -d ) >cvs.log 2>&1 &&
+ check_start_tree cvswork &&
+ check_file cvswork textfile.c v1 &&
+ check_file cvswork t2 v1 &&
+ check_file cvswork adir/afile v1.2 &&
+ check_file cvswork adir/a3file v1.2 &&
+ check_file cvswork adir/bdir/bfile v1.2 &&
+ check_file cvswork adir/bdir/b3file v1.2 &&
+ check_end_tree cvswork
'
test_expect_success 'cvs up (on b1 /)' '
- ( cd cvswork && cvs -f up -d ) >cvs.log 2>&1 &&
- check_start_tree cvswork &&
- check_file cvswork textfile.c v1.2 &&
- check_file cvswork t3 v1.2 &&
- check_file cvswork adir/afile v1.2 &&
- check_file cvswork adir/a3file v1.2 &&
- check_file cvswork adir/bdir/bfile v1.2 &&
- check_file cvswork adir/bdir/b3file v1.2 &&
- check_file cvswork cdir/cfile v1.2 &&
- check_end_tree cvswork
+ ( cd cvswork && cvs -f up -d ) >cvs.log 2>&1 &&
+ check_start_tree cvswork &&
+ check_file cvswork textfile.c v1.2 &&
+ check_file cvswork t3 v1.2 &&
+ check_file cvswork adir/afile v1.2 &&
+ check_file cvswork adir/a3file v1.2 &&
+ check_file cvswork adir/bdir/bfile v1.2 &&
+ check_file cvswork adir/bdir/b3file v1.2 &&
+ check_file cvswork cdir/cfile v1.2 &&
+ check_end_tree cvswork
'
# Make sure "CVS/Tag" files didn't get messed up:
test_expect_success 'cvs up (on b1 /) (again; check CVS/Tag files)' '
- ( cd cvswork && cvs -f up -d ) >cvs.log 2>&1 &&
- check_start_tree cvswork &&
- check_file cvswork textfile.c v1.2 &&
- check_file cvswork t3 v1.2 &&
- check_file cvswork adir/afile v1.2 &&
- check_file cvswork adir/a3file v1.2 &&
- check_file cvswork adir/bdir/bfile v1.2 &&
- check_file cvswork adir/bdir/b3file v1.2 &&
- check_file cvswork cdir/cfile v1.2 &&
- check_end_tree cvswork
+ ( cd cvswork && cvs -f up -d ) >cvs.log 2>&1 &&
+ check_start_tree cvswork &&
+ check_file cvswork textfile.c v1.2 &&
+ check_file cvswork t3 v1.2 &&
+ check_file cvswork adir/afile v1.2 &&
+ check_file cvswork adir/a3file v1.2 &&
+ check_file cvswork adir/bdir/bfile v1.2 &&
+ check_file cvswork adir/bdir/b3file v1.2 &&
+ check_file cvswork cdir/cfile v1.2 &&
+ check_end_tree cvswork
'
# update to another version:
test_expect_success 'cvs up -r v1' '
- ( cd cvswork && cvs -f up -r v1 ) >cvs.log 2>&1 &&
- check_start_tree cvswork &&
- check_file cvswork textfile.c v1 &&
- check_file cvswork t2 v1 &&
- check_file cvswork adir/afile v1 &&
- check_file cvswork adir/a2file v1 &&
- check_file cvswork adir/bdir/bfile v1 &&
- check_file cvswork adir/bdir/b2file v1 &&
- check_end_tree cvswork
+ ( cd cvswork && cvs -f up -r v1 ) >cvs.log 2>&1 &&
+ check_start_tree cvswork &&
+ check_file cvswork textfile.c v1 &&
+ check_file cvswork t2 v1 &&
+ check_file cvswork adir/afile v1 &&
+ check_file cvswork adir/a2file v1 &&
+ check_file cvswork adir/bdir/bfile v1 &&
+ check_file cvswork adir/bdir/b2file v1 &&
+ check_end_tree cvswork
'
test_expect_success 'cvs up' '
- ( cd cvswork && cvs -f up ) >cvs.log 2>&1 &&
- check_start_tree cvswork &&
- check_file cvswork textfile.c v1 &&
- check_file cvswork t2 v1 &&
- check_file cvswork adir/afile v1 &&
- check_file cvswork adir/a2file v1 &&
- check_file cvswork adir/bdir/bfile v1 &&
- check_file cvswork adir/bdir/b2file v1 &&
- check_end_tree cvswork
+ ( cd cvswork && cvs -f up ) >cvs.log 2>&1 &&
+ check_start_tree cvswork &&
+ check_file cvswork textfile.c v1 &&
+ check_file cvswork t2 v1 &&
+ check_file cvswork adir/afile v1 &&
+ check_file cvswork adir/a2file v1 &&
+ check_file cvswork adir/bdir/bfile v1 &&
+ check_file cvswork adir/bdir/b2file v1 &&
+ check_end_tree cvswork
'
test_expect_success 'cvs up (again; check CVS/Tag files)' '
- ( cd cvswork && cvs -f up -d ) >cvs.log 2>&1 &&
- check_start_tree cvswork &&
- check_file cvswork textfile.c v1 &&
- check_file cvswork t2 v1 &&
- check_file cvswork adir/afile v1 &&
- check_file cvswork adir/a2file v1 &&
- check_file cvswork adir/bdir/bfile v1 &&
- check_file cvswork adir/bdir/b2file v1 &&
- check_end_tree cvswork
+ ( cd cvswork && cvs -f up -d ) >cvs.log 2>&1 &&
+ check_start_tree cvswork &&
+ check_file cvswork textfile.c v1 &&
+ check_file cvswork t2 v1 &&
+ check_file cvswork adir/afile v1 &&
+ check_file cvswork adir/a2file v1 &&
+ check_file cvswork adir/bdir/bfile v1 &&
+ check_file cvswork adir/bdir/b2file v1 &&
+ check_end_tree cvswork
'
test_expect_success 'setup simple b2' '
- git branch b2 v1 &&
- git push --tags gitcvs.git b2:b2
+ git branch b2 v1 &&
+ git push --tags gitcvs.git b2:b2
'
test_expect_success 'cvs co b2 [into cvswork2]' '
- cvs -f co -r b2 -d cvswork2 master >cvs.log 2>&1 &&
- check_start_tree cvswork &&
- check_file cvswork textfile.c v1 &&
- check_file cvswork t2 v1 &&
- check_file cvswork adir/afile v1 &&
- check_file cvswork adir/a2file v1 &&
- check_file cvswork adir/bdir/bfile v1 &&
- check_file cvswork adir/bdir/b2file v1 &&
- check_end_tree cvswork
+ cvs -f co -r b2 -d cvswork2 master >cvs.log 2>&1 &&
+ check_start_tree cvswork &&
+ check_file cvswork textfile.c v1 &&
+ check_file cvswork t2 v1 &&
+ check_file cvswork adir/afile v1 &&
+ check_file cvswork adir/a2file v1 &&
+ check_file cvswork adir/bdir/bfile v1 &&
+ check_file cvswork adir/bdir/b2file v1 &&
+ check_end_tree cvswork
'
test_expect_success 'root dir edit [cvswork2]' '
- (
- cd cvswork2 && echo "Line 2" >>textfile.c &&
- ! cvs -f diff -u >"$WORKDIR/cvsEdit1.diff" &&
- cvs -f commit -m "edit textfile.c" textfile.c
- ) >cvsEdit1.log 2>&1
+ (
+ cd cvswork2 && echo "Line 2" >>textfile.c &&
+ ! cvs -f diff -u >"$WORKDIR/cvsEdit1.diff" &&
+ cvs -f commit -m "edit textfile.c" textfile.c
+ ) >cvsEdit1.log 2>&1
'
test_expect_success 'root dir rm file [cvswork2]' '
- (
- cd cvswork2 &&
- cvs -f rm -f t2 &&
- cvs -f diff -u >../cvsEdit2-empty.diff &&
- ! cvs -f diff -N -u >"$WORKDIR/cvsEdit2-N.diff" &&
- cvs -f commit -m "rm t2"
- ) >cvsEdit2.log 2>&1
+ (
+ cd cvswork2 &&
+ cvs -f rm -f t2 &&
+ cvs -f diff -u >../cvsEdit2-empty.diff &&
+ ! cvs -f diff -N -u >"$WORKDIR/cvsEdit2-N.diff" &&
+ cvs -f commit -m "rm t2"
+ ) >cvsEdit2.log 2>&1
'
test_expect_success 'subdir edit/add/rm files [cvswork2]' '
- (
- cd cvswork2 &&
- sed -e "s/line 1/line 1 (v2)/" adir/bdir/bfile >adir/bdir/bfileNEW &&
- mv -f adir/bdir/bfileNEW adir/bdir/bfile &&
- rm adir/bdir/b2file &&
- cd adir &&
- cvs -f rm bdir/b2file &&
- echo "4th file" >bdir/b4file &&
- cvs -f add bdir/b4file &&
- ! cvs -f diff -N -u >"$WORKDIR/cvsEdit3.diff" &&
- git fetch gitcvs.git b2:b2 &&
- (
- cd .. &&
- ! cvs -f diff -u -N -r v1.2 >"$WORKDIR/cvsEdit3-v1.2.diff" &&
- ! cvs -f diff -u -N -r v1.2 -r v1 >"$WORKDIR/cvsEdit3-v1.2-v1.diff"
- ) &&
- cvs -f commit -m "various add/rm/edit"
- ) >cvs.log 2>&1
+ (
+ cd cvswork2 &&
+ sed -e "s/line 1/line 1 (v2)/" adir/bdir/bfile >adir/bdir/bfileNEW &&
+ mv -f adir/bdir/bfileNEW adir/bdir/bfile &&
+ rm adir/bdir/b2file &&
+ cd adir &&
+ cvs -f rm bdir/b2file &&
+ echo "4th file" >bdir/b4file &&
+ cvs -f add bdir/b4file &&
+ ! cvs -f diff -N -u >"$WORKDIR/cvsEdit3.diff" &&
+ git fetch gitcvs.git b2:b2 &&
+ (
+ cd .. &&
+ ! cvs -f diff -u -N -r v1.2 >"$WORKDIR/cvsEdit3-v1.2.diff" &&
+ ! cvs -f diff -u -N -r v1.2 -r v1 >"$WORKDIR/cvsEdit3-v1.2-v1.diff"
+ ) &&
+ cvs -f commit -m "various add/rm/edit"
+ ) >cvs.log 2>&1
'
test_expect_success 'validate result of edits [cvswork2]' '
- git fetch gitcvs.git b2:b2 &&
- git tag v2 b2 &&
- git push --tags gitcvs.git b2:b2 &&
- check_start_tree cvswork2 &&
- check_file cvswork2 textfile.c v2 &&
- check_file cvswork2 adir/afile v2 &&
- check_file cvswork2 adir/a2file v2 &&
- check_file cvswork2 adir/bdir/bfile v2 &&
- check_file cvswork2 adir/bdir/b4file v2 &&
- check_end_full_tree cvswork2 v2
+ git fetch gitcvs.git b2:b2 &&
+ git tag v2 b2 &&
+ git push --tags gitcvs.git b2:b2 &&
+ check_start_tree cvswork2 &&
+ check_file cvswork2 textfile.c v2 &&
+ check_file cvswork2 adir/afile v2 &&
+ check_file cvswork2 adir/a2file v2 &&
+ check_file cvswork2 adir/bdir/bfile v2 &&
+ check_file cvswork2 adir/bdir/b4file v2 &&
+ check_end_full_tree cvswork2 v2
'
test_expect_success 'validate basic diffs saved during above cvswork2 edits' '
- test $(grep Index: cvsEdit1.diff | wc -l) = 1 &&
- test ! -s cvsEdit2-empty.diff &&
- test $(grep Index: cvsEdit2-N.diff | wc -l) = 1 &&
- test $(grep Index: cvsEdit3.diff | wc -l) = 3 &&
- rm -rf diffSandbox &&
- git clone -q -n . diffSandbox &&
- (
- cd diffSandbox &&
- git checkout v1 &&
- git apply -p0 --index <"$WORKDIR/cvsEdit1.diff" &&
- git apply -p0 --index <"$WORKDIR/cvsEdit2-N.diff" &&
- git apply -p0 --directory=adir --index <"$WORKDIR/cvsEdit3.diff" &&
- git diff --exit-code v2
- ) >"check_diff_apply.out" 2>&1
+ test $(grep Index: cvsEdit1.diff | wc -l) = 1 &&
+ test ! -s cvsEdit2-empty.diff &&
+ test $(grep Index: cvsEdit2-N.diff | wc -l) = 1 &&
+ test $(grep Index: cvsEdit3.diff | wc -l) = 3 &&
+ rm -rf diffSandbox &&
+ git clone -q -n . diffSandbox &&
+ (
+ cd diffSandbox &&
+ git checkout v1 &&
+ git apply -p0 --index <"$WORKDIR/cvsEdit1.diff" &&
+ git apply -p0 --index <"$WORKDIR/cvsEdit2-N.diff" &&
+ git apply -p0 --directory=adir --index <"$WORKDIR/cvsEdit3.diff" &&
+ git diff --exit-code v2
+ ) >"check_diff_apply.out" 2>&1
'
test_expect_success 'validate v1.2 diff saved during last cvswork2 edit' '
- test $(grep Index: cvsEdit3-v1.2.diff | wc -l) = 9 &&
- check_diff cvsEdit3-v1.2.diff v1.2 v2
+ test $(grep Index: cvsEdit3-v1.2.diff | wc -l) = 9 &&
+ check_diff cvsEdit3-v1.2.diff v1.2 v2
'
test_expect_success 'validate v1.2 v1 diff saved during last cvswork2 edit' '
- test $(grep Index: cvsEdit3-v1.2-v1.diff | wc -l) = 9 &&
- check_diff cvsEdit3-v1.2-v1.diff v1.2 v1
+ test $(grep Index: cvsEdit3-v1.2-v1.diff | wc -l) = 9 &&
+ check_diff cvsEdit3-v1.2-v1.diff v1.2 v1
'
test_expect_success 'cvs up [cvswork2]' '
- ( cd cvswork2 && cvs -f up ) >cvs.log 2>&1 &&
- check_start_tree cvswork2 &&
- check_file cvswork2 textfile.c v2 &&
- check_file cvswork2 adir/afile v2 &&
- check_file cvswork2 adir/a2file v2 &&
- check_file cvswork2 adir/bdir/bfile v2 &&
- check_file cvswork2 adir/bdir/b4file v2 &&
- check_end_full_tree cvswork2 v2
+ ( cd cvswork2 && cvs -f up ) >cvs.log 2>&1 &&
+ check_start_tree cvswork2 &&
+ check_file cvswork2 textfile.c v2 &&
+ check_file cvswork2 adir/afile v2 &&
+ check_file cvswork2 adir/a2file v2 &&
+ check_file cvswork2 adir/bdir/bfile v2 &&
+ check_file cvswork2 adir/bdir/b4file v2 &&
+ check_end_full_tree cvswork2 v2
'
test_expect_success 'cvs up -r b2 [back to cvswork]' '
- ( cd cvswork && cvs -f up -r b2 ) >cvs.log 2>&1 &&
- check_start_tree cvswork &&
- check_file cvswork textfile.c v2 &&
- check_file cvswork adir/afile v2 &&
- check_file cvswork adir/a2file v2 &&
- check_file cvswork adir/bdir/bfile v2 &&
- check_file cvswork adir/bdir/b4file v2 &&
- check_end_full_tree cvswork v2
+ ( cd cvswork && cvs -f up -r b2 ) >cvs.log 2>&1 &&
+ check_start_tree cvswork &&
+ check_file cvswork textfile.c v2 &&
+ check_file cvswork adir/afile v2 &&
+ check_file cvswork adir/a2file v2 &&
+ check_file cvswork adir/bdir/bfile v2 &&
+ check_file cvswork adir/bdir/b4file v2 &&
+ check_end_full_tree cvswork v2
'
test_expect_success 'cvs up -r b1' '
- ( cd cvswork && cvs -f up -r b1 ) >cvs.log 2>&1 &&
- check_start_tree cvswork &&
- check_file cvswork textfile.c v1.2 &&
- check_file cvswork t3 v1.2 &&
- check_file cvswork adir/afile v1.2 &&
- check_file cvswork adir/a3file v1.2 &&
- check_file cvswork adir/bdir/bfile v1.2 &&
- check_file cvswork adir/bdir/b3file v1.2 &&
- check_file cvswork cdir/cfile v1.2 &&
- check_end_full_tree cvswork v1.2
+ ( cd cvswork && cvs -f up -r b1 ) >cvs.log 2>&1 &&
+ check_start_tree cvswork &&
+ check_file cvswork textfile.c v1.2 &&
+ check_file cvswork t3 v1.2 &&
+ check_file cvswork adir/afile v1.2 &&
+ check_file cvswork adir/a3file v1.2 &&
+ check_file cvswork adir/bdir/bfile v1.2 &&
+ check_file cvswork adir/bdir/b3file v1.2 &&
+ check_file cvswork cdir/cfile v1.2 &&
+ check_end_full_tree cvswork v1.2
'
test_expect_success 'cvs up -A' '
- ( cd cvswork && cvs -f up -A ) >cvs.log 2>&1 &&
- check_start_tree cvswork &&
- check_file cvswork textfile.c v1 &&
- check_file cvswork t2 v1 &&
- check_file cvswork adir/afile v1 &&
- check_file cvswork adir/a2file v1 &&
- check_file cvswork adir/bdir/bfile v1 &&
- check_file cvswork adir/bdir/b2file v1 &&
- check_end_full_tree cvswork v1
+ ( cd cvswork && cvs -f up -A ) >cvs.log 2>&1 &&
+ check_start_tree cvswork &&
+ check_file cvswork textfile.c v1 &&
+ check_file cvswork t2 v1 &&
+ check_file cvswork adir/afile v1 &&
+ check_file cvswork adir/a2file v1 &&
+ check_file cvswork adir/bdir/bfile v1 &&
+ check_file cvswork adir/bdir/b2file v1 &&
+ check_end_full_tree cvswork v1
'
test_expect_success 'cvs up (check CVS/Tag files)' '
- ( cd cvswork && cvs -f up ) >cvs.log 2>&1 &&
- check_start_tree cvswork &&
- check_file cvswork textfile.c v1 &&
- check_file cvswork t2 v1 &&
- check_file cvswork adir/afile v1 &&
- check_file cvswork adir/a2file v1 &&
- check_file cvswork adir/bdir/bfile v1 &&
- check_file cvswork adir/bdir/b2file v1 &&
- check_end_full_tree cvswork v1
+ ( cd cvswork && cvs -f up ) >cvs.log 2>&1 &&
+ check_start_tree cvswork &&
+ check_file cvswork textfile.c v1 &&
+ check_file cvswork t2 v1 &&
+ check_file cvswork adir/afile v1 &&
+ check_file cvswork adir/a2file v1 &&
+ check_file cvswork adir/bdir/bfile v1 &&
+ check_file cvswork adir/bdir/b2file v1 &&
+ check_end_full_tree cvswork v1
'
# This is not really legal CVS, but it seems to work anyway:
test_expect_success 'cvs up -r heads/b1' '
- ( cd cvswork && cvs -f up -r heads/b1 ) >cvs.log 2>&1 &&
- check_start_tree cvswork &&
- check_file cvswork textfile.c v1.2 &&
- check_file cvswork t3 v1.2 &&
- check_file cvswork adir/afile v1.2 &&
- check_file cvswork adir/a3file v1.2 &&
- check_file cvswork adir/bdir/bfile v1.2 &&
- check_file cvswork adir/bdir/b3file v1.2 &&
- check_file cvswork cdir/cfile v1.2 &&
- check_end_full_tree cvswork v1.2
+ ( cd cvswork && cvs -f up -r heads/b1 ) >cvs.log 2>&1 &&
+ check_start_tree cvswork &&
+ check_file cvswork textfile.c v1.2 &&
+ check_file cvswork t3 v1.2 &&
+ check_file cvswork adir/afile v1.2 &&
+ check_file cvswork adir/a3file v1.2 &&
+ check_file cvswork adir/bdir/bfile v1.2 &&
+ check_file cvswork adir/bdir/b3file v1.2 &&
+ check_file cvswork cdir/cfile v1.2 &&
+ check_end_full_tree cvswork v1.2
'
# But this should work even if CVS client checks -r more carefully:
test_expect_success 'cvs up -r heads_-s-b2 (cvsserver escape mechanism)' '
- ( cd cvswork && cvs -f up -r heads_-s-b2 ) >cvs.log 2>&1 &&
- check_start_tree cvswork &&
- check_file cvswork textfile.c v2 &&
- check_file cvswork adir/afile v2 &&
- check_file cvswork adir/a2file v2 &&
- check_file cvswork adir/bdir/bfile v2 &&
- check_file cvswork adir/bdir/b4file v2 &&
- check_end_full_tree cvswork v2
+ ( cd cvswork && cvs -f up -r heads_-s-b2 ) >cvs.log 2>&1 &&
+ check_start_tree cvswork &&
+ check_file cvswork textfile.c v2 &&
+ check_file cvswork adir/afile v2 &&
+ check_file cvswork adir/a2file v2 &&
+ check_file cvswork adir/bdir/bfile v2 &&
+ check_file cvswork adir/bdir/b4file v2 &&
+ check_end_full_tree cvswork v2
'
v1hash=$(git rev-parse v1)
test_expect_success 'cvs up -r $(git rev-parse v1)' '
- test -n "$v1hash" &&
- ( cd cvswork && cvs -f up -r "$v1hash" ) >cvs.log 2>&1 &&
- check_start_tree cvswork &&
- check_file cvswork textfile.c v1 &&
- check_file cvswork t2 v1 &&
- check_file cvswork adir/afile v1 &&
- check_file cvswork adir/a2file v1 &&
- check_file cvswork adir/bdir/bfile v1 &&
- check_file cvswork adir/bdir/b2file v1 &&
- check_end_full_tree cvswork v1
+ test -n "$v1hash" &&
+ ( cd cvswork && cvs -f up -r "$v1hash" ) >cvs.log 2>&1 &&
+ check_start_tree cvswork &&
+ check_file cvswork textfile.c v1 &&
+ check_file cvswork t2 v1 &&
+ check_file cvswork adir/afile v1 &&
+ check_file cvswork adir/a2file v1 &&
+ check_file cvswork adir/bdir/bfile v1 &&
+ check_file cvswork adir/bdir/b2file v1 &&
+ check_end_full_tree cvswork v1
'
test_expect_success 'cvs diff -r v1 -u' '
- ( cd cvswork && cvs -f diff -r v1 -u ) >cvsDiff.out 2>cvs.log &&
- test ! -s cvsDiff.out &&
- test ! -s cvs.log
+ ( cd cvswork && cvs -f diff -r v1 -u ) >cvsDiff.out 2>cvs.log &&
+ test ! -s cvsDiff.out &&
+ test ! -s cvs.log
'
test_expect_success 'cvs diff -N -r v2 -u' '
- ( cd cvswork && ! cvs -f diff -N -r v2 -u ) >cvsDiff.out 2>cvs.log &&
- test ! -s cvs.log &&
- test -s cvsDiff.out &&
- check_diff cvsDiff.out v2 v1 >check_diff.out 2>&1
+ ( cd cvswork && ! cvs -f diff -N -r v2 -u ) >cvsDiff.out 2>cvs.log &&
+ test ! -s cvs.log &&
+ test -s cvsDiff.out &&
+ check_diff cvsDiff.out v2 v1 >check_diff.out 2>&1
'
test_expect_success 'cvs diff -N -r v2 -r v1.2' '
- ( cd cvswork && ! cvs -f diff -N -r v2 -r v1.2 -u ) >cvsDiff.out 2>cvs.log &&
- test ! -s cvs.log &&
- test -s cvsDiff.out &&
- check_diff cvsDiff.out v2 v1.2 >check_diff.out 2>&1
+ ( cd cvswork && ! cvs -f diff -N -r v2 -r v1.2 -u ) >cvsDiff.out 2>cvs.log &&
+ test ! -s cvs.log &&
+ test -s cvsDiff.out &&
+ check_diff cvsDiff.out v2 v1.2 >check_diff.out 2>&1
'
test_expect_success 'apply early [cvswork3] diff to b3' '
- git clone -q . gitwork3 &&
- (
- cd gitwork3 &&
- git checkout -b b3 v1 &&
- git apply -p0 --index <"$WORKDIR/cvswork3edit.diff" &&
- git commit -m "cvswork3 edits applied"
- ) &&
- git fetch gitwork3 b3:b3 &&
- git tag v3 b3
+ git clone -q . gitwork3 &&
+ (
+ cd gitwork3 &&
+ git checkout -b b3 v1 &&
+ git apply -p0 --index <"$WORKDIR/cvswork3edit.diff" &&
+ git commit -m "cvswork3 edits applied"
+ ) &&
+ git fetch gitwork3 b3:b3 &&
+ git tag v3 b3
'
test_expect_success 'check [cvswork3] diff' '
- ( cd cvswork3 && ! cvs -f diff -N -u ) >"$WORKDIR/cvsDiff.out" 2>cvs.log &&
- test ! -s cvs.log &&
- test -s cvsDiff.out &&
- test $(grep Index: cvsDiff.out | wc -l) = 3 &&
- test_cmp cvsDiff.out cvswork3edit.diff &&
- check_diff cvsDiff.out v1 v3 >check_diff.out 2>&1
+ ( cd cvswork3 && ! cvs -f diff -N -u ) >"$WORKDIR/cvsDiff.out" 2>cvs.log &&
+ test ! -s cvs.log &&
+ test -s cvsDiff.out &&
+ test $(grep Index: cvsDiff.out | wc -l) = 3 &&
+ test_cmp cvsDiff.out cvswork3edit.diff &&
+ check_diff cvsDiff.out v1 v3 >check_diff.out 2>&1
'
test_expect_success 'merge early [cvswork3] b3 with b1' '
- ( cd gitwork3 && git merge "message" HEAD b1 ) &&
- git fetch gitwork3 b3:b3 &&
- git tag v3merged b3 &&
- git push --tags gitcvs.git b3:b3
+ ( cd gitwork3 && git merge "message" HEAD b1 ) &&
+ git fetch gitwork3 b3:b3 &&
+ git tag v3merged b3 &&
+ git push --tags gitcvs.git b3:b3
'
# This test would fail if cvsserver properly created a ".#afile"* file
@@ -506,45 +506,45 @@ test_expect_success 'merge early [cvswork3] b3 with b1' '
# TODO: Validate that the .# file was saved properly, and then
# delete/ignore it when checking the tree.
test_expect_success 'cvs up dirty [cvswork3]' '
- (
- cd cvswork3 &&
- cvs -f up &&
- ! cvs -f diff -N -u >"$WORKDIR/cvsDiff.out"
- ) >cvs.log 2>&1 &&
- test -s cvsDiff.out &&
- test $(grep Index: cvsDiff.out | wc -l) = 2 &&
- check_start_tree cvswork3 &&
- check_file cvswork3 textfile.c v3merged &&
- check_file cvswork3 t3 v3merged &&
- check_file cvswork3 adir/afile v3merged &&
- check_file cvswork3 adir/a3file v3merged &&
- check_file cvswork3 adir/afile5 v3merged &&
- check_file cvswork3 adir/bdir/bfile v3merged &&
- check_file cvswork3 adir/bdir/b3file v3merged &&
- check_file cvswork3 cdir/cfile v3merged &&
- check_end_full_tree cvswork3 v3merged
+ (
+ cd cvswork3 &&
+ cvs -f up &&
+ ! cvs -f diff -N -u >"$WORKDIR/cvsDiff.out"
+ ) >cvs.log 2>&1 &&
+ test -s cvsDiff.out &&
+ test $(grep Index: cvsDiff.out | wc -l) = 2 &&
+ check_start_tree cvswork3 &&
+ check_file cvswork3 textfile.c v3merged &&
+ check_file cvswork3 t3 v3merged &&
+ check_file cvswork3 adir/afile v3merged &&
+ check_file cvswork3 adir/a3file v3merged &&
+ check_file cvswork3 adir/afile5 v3merged &&
+ check_file cvswork3 adir/bdir/bfile v3merged &&
+ check_file cvswork3 adir/bdir/b3file v3merged &&
+ check_file cvswork3 cdir/cfile v3merged &&
+ check_end_full_tree cvswork3 v3merged
'
# TODO: test cvs status
test_expect_success 'cvs commit [cvswork3]' '
- (
- cd cvswork3 &&
- cvs -f commit -m "dirty sandbox after auto-merge"
- ) >cvs.log 2>&1 &&
- check_start_tree cvswork3 &&
- check_file cvswork3 textfile.c v3merged &&
- check_file cvswork3 t3 v3merged &&
- check_file cvswork3 adir/afile v3merged &&
- check_file cvswork3 adir/a3file v3merged &&
- check_file cvswork3 adir/afile5 v3merged &&
- check_file cvswork3 adir/bdir/bfile v3merged &&
- check_file cvswork3 adir/bdir/b3file v3merged &&
- check_file cvswork3 cdir/cfile v3merged &&
- check_end_full_tree cvswork3 v3merged &&
- git fetch gitcvs.git b3:b4 &&
- git tag v4.1 b4 &&
- git diff --exit-code v4.1 v3merged >check_diff_apply.out 2>&1
+ (
+ cd cvswork3 &&
+ cvs -f commit -m "dirty sandbox after auto-merge"
+ ) >cvs.log 2>&1 &&
+ check_start_tree cvswork3 &&
+ check_file cvswork3 textfile.c v3merged &&
+ check_file cvswork3 t3 v3merged &&
+ check_file cvswork3 adir/afile v3merged &&
+ check_file cvswork3 adir/a3file v3merged &&
+ check_file cvswork3 adir/afile5 v3merged &&
+ check_file cvswork3 adir/bdir/bfile v3merged &&
+ check_file cvswork3 adir/bdir/b3file v3merged &&
+ check_file cvswork3 cdir/cfile v3merged &&
+ check_end_full_tree cvswork3 v3merged &&
+ git fetch gitcvs.git b3:b4 &&
+ git tag v4.1 b4 &&
+ git diff --exit-code v4.1 v3merged >check_diff_apply.out 2>&1
'
test_done
--
1.8.0.197.g5a90748
^ permalink raw reply related
* [PATCH 7/8] t9402: Rename check.cvsCount and check.list
From: Torsten Bögershausen @ 2012-12-08 21:35 UTC (permalink / raw)
To: git; +Cc: tboegi, mmogilvi_git
Checking and comparing the number of line in check.list and check.cvsCount
had been replaced by comparing both files line by line.
Rename the filenames to make clear which is expected and which is actual:
check.list -> list.expected
check.cvsCount-> list.actual
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
t/t9402-git-cvsserver-refs.sh | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/t/t9402-git-cvsserver-refs.sh b/t/t9402-git-cvsserver-refs.sh
index fadc80a..8dc4848 100755
--- a/t/t9402-git-cvsserver-refs.sh
+++ b/t/t9402-git-cvsserver-refs.sh
@@ -10,7 +10,7 @@ tags, branches and other git refspecs'
#########
check_start_tree() {
- rm -f "$WORKDIR/check.list"
+ rm -f "$WORKDIR/list.expected"
echo "start $1" >>"${WORKDIR}/check.log"
}
@@ -23,22 +23,22 @@ check_file() {
test_cmp "$WORKDIR/check.got" "$sandbox/$file"
stat=$?
echo "check_file $sandbox $file $ver : $stat" >>"$WORKDIR/check.log"
- echo "$file" >>"$WORKDIR/check.list"
+ echo "$file" >>"$WORKDIR/list.expected"
return $stat
}
check_end_tree() {
sandbox="$1" &&
- find "$sandbox" -name CVS -prune -o -type f -print >"$WORKDIR/check.cvsCount" &&
- sort <"$WORKDIR/check.list" >expected &&
- sort <"$WORKDIR/check.cvsCount" | sed -e "s%cvswork/%%" >actual &&
+ find "$sandbox" -name CVS -prune -o -type f -print >"$WORKDIR/list.actual" &&
+ sort <"$WORKDIR/list.expected" >expected &&
+ sort <"$WORKDIR/list.actual" | sed -e "s%cvswork/%%" >actual &&
test_cmp expected actual &&
rm expected actual
}
check_end_full_tree() {
sandbox="$1" &&
- sort <"$WORKDIR/check.list" >expected &&
+ sort <"$WORKDIR/list.expected" >expected &&
find "$sandbox" -name CVS -prune -o -type f -print | sed -e "s%$sandbox/%%" | sort >act1 &&
test_cmp expected act1 &&
git ls-tree --name-only -r "$2" | sort >act2 &&
--
1.8.0.197.g5a90748
^ permalink raw reply related
* [PATCH 6/8] t9402: Simplify git ls-tree
From: Torsten Bögershausen @ 2012-12-08 21:35 UTC (permalink / raw)
To: git; +Cc: tboegi, mmogilvi_git
Use "git ls-tree --name-only" which does not need a sed to filter out the sha
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
t/t9402-git-cvsserver-refs.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t9402-git-cvsserver-refs.sh b/t/t9402-git-cvsserver-refs.sh
index d525778..fadc80a 100755
--- a/t/t9402-git-cvsserver-refs.sh
+++ b/t/t9402-git-cvsserver-refs.sh
@@ -41,7 +41,7 @@ check_end_full_tree() {
sort <"$WORKDIR/check.list" >expected &&
find "$sandbox" -name CVS -prune -o -type f -print | sed -e "s%$sandbox/%%" | sort >act1 &&
test_cmp expected act1 &&
- git ls-tree -r "$2" | sed -e "s/^.*blob [0-9a-fA-F]*[ ]*//" | sort >act2 &&
+ git ls-tree --name-only -r "$2" | sort >act2 &&
test_cmp expected act2 &&
rm expected act1 act2
}
--
1.8.0.197.g5a90748
^ permalink raw reply related
* [PATCH 6/8] t9402: Simplify git ls-tree
From: Torsten Bögershausen @ 2012-12-08 21:35 UTC (permalink / raw)
To: git; +Cc: tboegi, mmogilvi_git
Use "git ls-tree --name-only" which does not need a sed to filter out the sha
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
t/t9402-git-cvsserver-refs.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t9402-git-cvsserver-refs.sh b/t/t9402-git-cvsserver-refs.sh
index d525778..fadc80a 100755
--- a/t/t9402-git-cvsserver-refs.sh
+++ b/t/t9402-git-cvsserver-refs.sh
@@ -41,7 +41,7 @@ check_end_full_tree() {
sort <"$WORKDIR/check.list" >expected &&
find "$sandbox" -name CVS -prune -o -type f -print | sed -e "s%$sandbox/%%" | sort >act1 &&
test_cmp expected act1 &&
- git ls-tree -r "$2" | sed -e "s/^.*blob [0-9a-fA-F]*[ ]*//" | sort >act2 &&
+ git ls-tree --name-only -r "$2" | sort >act2 &&
test_cmp expected act2 &&
rm expected act1 act2
}
--
1.8.0.197.g5a90748
^ permalink raw reply related
* [PATCH 5/8] t9402: Add missing &&; Code style
From: Torsten Bögershausen @ 2012-12-08 21:34 UTC (permalink / raw)
To: git; +Cc: tboegi, mmogilvi_git
Add missing && at 2 places
Re-formated the sub-shell parantheses (coding style)
Added missing ] in the test_expect_success header at 2 places
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
t/t9402-git-cvsserver-refs.sh | 110 ++++++++++++++++++++----------------------
1 file changed, 52 insertions(+), 58 deletions(-)
diff --git a/t/t9402-git-cvsserver-refs.sh b/t/t9402-git-cvsserver-refs.sh
index 2f63331..d525778 100755
--- a/t/t9402-git-cvsserver-refs.sh
+++ b/t/t9402-git-cvsserver-refs.sh
@@ -54,10 +54,12 @@ check_diff() {
vNew="$3"
rm -rf diffSandbox
git clone -q -n . diffSandbox &&
- ( cd diffSandbox &&
+ (
+ cd diffSandbox &&
git checkout "$vOld" &&
git apply -p0 --index <"../$diffFile" &&
- git diff --exit-code "$vNew" ) >check_diff_apply.out 2>&1
+ git diff --exit-code "$vNew"
+ ) >check_diff_apply.out 2>&1
}
#########
@@ -149,7 +151,8 @@ test_expect_success 'cvs co b1 [cvswork3]' '
'
test_expect_success 'edit cvswork3 and save diff' '
- ( cd cvswork3 &&
+ (
+ cd cvswork3 &&
sed -e "s/line1/line1 - data/" adir/afile >adir/afileNEW &&
mv -f adir/afileNEW adir/afile &&
echo "afile5" >adir/afile5 &&
@@ -180,8 +183,7 @@ test_expect_success 'setup v1.2 on b1' '
'
test_expect_success 'cvs -f up (on b1 adir)' '
- ( cd cvswork/adir &&
- cvs -f up -d ) >cvs.log 2>&1 &&
+ ( cd cvswork/adir && cvs -f up -d ) >cvs.log 2>&1 &&
check_start_tree cvswork &&
check_file cvswork textfile.c v1 &&
check_file cvswork t2 v1 &&
@@ -193,8 +195,7 @@ test_expect_success 'cvs -f up (on b1 adir)' '
'
test_expect_success 'cvs up (on b1 /)' '
- ( cd cvswork &&
- cvs -f up -d ) >cvs.log 2>&1 &&
+ ( cd cvswork && cvs -f up -d ) >cvs.log 2>&1 &&
check_start_tree cvswork &&
check_file cvswork textfile.c v1.2 &&
check_file cvswork t3 v1.2 &&
@@ -208,8 +209,7 @@ test_expect_success 'cvs up (on b1 /)' '
# Make sure "CVS/Tag" files didn't get messed up:
test_expect_success 'cvs up (on b1 /) (again; check CVS/Tag files)' '
- ( cd cvswork &&
- cvs -f up -d ) >cvs.log 2>&1 &&
+ ( cd cvswork && cvs -f up -d ) >cvs.log 2>&1 &&
check_start_tree cvswork &&
check_file cvswork textfile.c v1.2 &&
check_file cvswork t3 v1.2 &&
@@ -223,8 +223,7 @@ test_expect_success 'cvs up (on b1 /) (again; check CVS/Tag files)' '
# update to another version:
test_expect_success 'cvs up -r v1' '
- ( cd cvswork &&
- cvs -f up -r v1 ) >cvs.log 2>&1 &&
+ ( cd cvswork && cvs -f up -r v1 ) >cvs.log 2>&1 &&
check_start_tree cvswork &&
check_file cvswork textfile.c v1 &&
check_file cvswork t2 v1 &&
@@ -236,8 +235,7 @@ test_expect_success 'cvs up -r v1' '
'
test_expect_success 'cvs up' '
- ( cd cvswork &&
- cvs -f up ) >cvs.log 2>&1 &&
+ ( cd cvswork && cvs -f up ) >cvs.log 2>&1 &&
check_start_tree cvswork &&
check_file cvswork textfile.c v1 &&
check_file cvswork t2 v1 &&
@@ -249,8 +247,7 @@ test_expect_success 'cvs up' '
'
test_expect_success 'cvs up (again; check CVS/Tag files)' '
- ( cd cvswork &&
- cvs -f up -d ) >cvs.log 2>&1 &&
+ ( cd cvswork && cvs -f up -d ) >cvs.log 2>&1 &&
check_start_tree cvswork &&
check_file cvswork textfile.c v1 &&
check_file cvswork t2 v1 &&
@@ -279,15 +276,16 @@ test_expect_success 'cvs co b2 [into cvswork2]' '
'
test_expect_success 'root dir edit [cvswork2]' '
- ( cd cvswork2 &&
- echo "Line 2" >>textfile.c &&
+ (
+ cd cvswork2 && echo "Line 2" >>textfile.c &&
! cvs -f diff -u >"$WORKDIR/cvsEdit1.diff" &&
cvs -f commit -m "edit textfile.c" textfile.c
) >cvsEdit1.log 2>&1
'
test_expect_success 'root dir rm file [cvswork2]' '
- ( cd cvswork2 &&
+ (
+ cd cvswork2 &&
cvs -f rm -f t2 &&
cvs -f diff -u >../cvsEdit2-empty.diff &&
! cvs -f diff -N -u >"$WORKDIR/cvsEdit2-N.diff" &&
@@ -295,8 +293,9 @@ test_expect_success 'root dir rm file [cvswork2]' '
) >cvsEdit2.log 2>&1
'
-test_expect_success 'subdir edit/add/rm files [cvswork2' '
- ( cd cvswork2 &&
+test_expect_success 'subdir edit/add/rm files [cvswork2]' '
+ (
+ cd cvswork2 &&
sed -e "s/line 1/line 1 (v2)/" adir/bdir/bfile >adir/bdir/bfileNEW &&
mv -f adir/bdir/bfileNEW adir/bdir/bfile &&
rm adir/bdir/b2file &&
@@ -306,9 +305,10 @@ test_expect_success 'subdir edit/add/rm files [cvswork2' '
cvs -f add bdir/b4file &&
! cvs -f diff -N -u >"$WORKDIR/cvsEdit3.diff" &&
git fetch gitcvs.git b2:b2 &&
- ( cd .. &&
- ! cvs -f diff -u -N -r v1.2 >"$WORKDIR/cvsEdit3-v1.2.diff" &&
- ! cvs -f diff -u -N -r v1.2 -r v1 >"$WORKDIR/cvsEdit3-v1.2-v1.diff"
+ (
+ cd .. &&
+ ! cvs -f diff -u -N -r v1.2 >"$WORKDIR/cvsEdit3-v1.2.diff" &&
+ ! cvs -f diff -u -N -r v1.2 -r v1 >"$WORKDIR/cvsEdit3-v1.2-v1.diff"
) &&
cvs -f commit -m "various add/rm/edit"
) >cvs.log 2>&1
@@ -334,12 +334,14 @@ test_expect_success 'validate basic diffs saved during above cvswork2 edits' '
test $(grep Index: cvsEdit3.diff | wc -l) = 3 &&
rm -rf diffSandbox &&
git clone -q -n . diffSandbox &&
- ( cd diffSandbox &&
+ (
+ cd diffSandbox &&
git checkout v1 &&
git apply -p0 --index <"$WORKDIR/cvsEdit1.diff" &&
git apply -p0 --index <"$WORKDIR/cvsEdit2-N.diff" &&
git apply -p0 --directory=adir --index <"$WORKDIR/cvsEdit3.diff" &&
- git diff --exit-code v2 ) >"check_diff_apply.out" 2>&1
+ git diff --exit-code v2
+ ) >"check_diff_apply.out" 2>&1
'
test_expect_success 'validate v1.2 diff saved during last cvswork2 edit' '
@@ -353,8 +355,7 @@ test_expect_success 'validate v1.2 v1 diff saved during last cvswork2 edit' '
'
test_expect_success 'cvs up [cvswork2]' '
- ( cd cvswork2 &&
- cvs -f up ) >cvs.log 2>&1 &&
+ ( cd cvswork2 && cvs -f up ) >cvs.log 2>&1 &&
check_start_tree cvswork2 &&
check_file cvswork2 textfile.c v2 &&
check_file cvswork2 adir/afile v2 &&
@@ -365,8 +366,7 @@ test_expect_success 'cvs up [cvswork2]' '
'
test_expect_success 'cvs up -r b2 [back to cvswork]' '
- ( cd cvswork &&
- cvs -f up -r b2 ) >cvs.log 2>&1 &&
+ ( cd cvswork && cvs -f up -r b2 ) >cvs.log 2>&1 &&
check_start_tree cvswork &&
check_file cvswork textfile.c v2 &&
check_file cvswork adir/afile v2 &&
@@ -377,8 +377,7 @@ test_expect_success 'cvs up -r b2 [back to cvswork]' '
'
test_expect_success 'cvs up -r b1' '
- ( cd cvswork &&
- cvs -f up -r b1 ) >cvs.log 2>&1 &&
+ ( cd cvswork && cvs -f up -r b1 ) >cvs.log 2>&1 &&
check_start_tree cvswork &&
check_file cvswork textfile.c v1.2 &&
check_file cvswork t3 v1.2 &&
@@ -391,8 +390,7 @@ test_expect_success 'cvs up -r b1' '
'
test_expect_success 'cvs up -A' '
- ( cd cvswork &&
- cvs -f up -A ) >cvs.log 2>&1 &&
+ ( cd cvswork && cvs -f up -A ) >cvs.log 2>&1 &&
check_start_tree cvswork &&
check_file cvswork textfile.c v1 &&
check_file cvswork t2 v1 &&
@@ -404,8 +402,7 @@ test_expect_success 'cvs up -A' '
'
test_expect_success 'cvs up (check CVS/Tag files)' '
- ( cd cvswork &&
- cvs -f up ) >cvs.log 2>&1 &&
+ ( cd cvswork && cvs -f up ) >cvs.log 2>&1 &&
check_start_tree cvswork &&
check_file cvswork textfile.c v1 &&
check_file cvswork t2 v1 &&
@@ -418,8 +415,7 @@ test_expect_success 'cvs up (check CVS/Tag files)' '
# This is not really legal CVS, but it seems to work anyway:
test_expect_success 'cvs up -r heads/b1' '
- ( cd cvswork &&
- cvs -f up -r heads/b1 ) >cvs.log 2>&1 &&
+ ( cd cvswork && cvs -f up -r heads/b1 ) >cvs.log 2>&1 &&
check_start_tree cvswork &&
check_file cvswork textfile.c v1.2 &&
check_file cvswork t3 v1.2 &&
@@ -433,8 +429,7 @@ test_expect_success 'cvs up -r heads/b1' '
# But this should work even if CVS client checks -r more carefully:
test_expect_success 'cvs up -r heads_-s-b2 (cvsserver escape mechanism)' '
- ( cd cvswork &&
- cvs -f up -r heads_-s-b2 ) >cvs.log 2>&1 &&
+ ( cd cvswork && cvs -f up -r heads_-s-b2 ) >cvs.log 2>&1 &&
check_start_tree cvswork &&
check_file cvswork textfile.c v2 &&
check_file cvswork adir/afile v2 &&
@@ -447,8 +442,7 @@ test_expect_success 'cvs up -r heads_-s-b2 (cvsserver escape mechanism)' '
v1hash=$(git rev-parse v1)
test_expect_success 'cvs up -r $(git rev-parse v1)' '
test -n "$v1hash" &&
- ( cd cvswork &&
- cvs -f up -r "$v1hash" ) >cvs.log 2>&1 &&
+ ( cd cvswork && cvs -f up -r "$v1hash" ) >cvs.log 2>&1 &&
check_start_tree cvswork &&
check_file cvswork textfile.c v1 &&
check_file cvswork t2 v1 &&
@@ -460,23 +454,20 @@ test_expect_success 'cvs up -r $(git rev-parse v1)' '
'
test_expect_success 'cvs diff -r v1 -u' '
- ( cd cvswork &&
- cvs -f diff -r v1 -u ) >cvsDiff.out 2>cvs.log &&
+ ( cd cvswork && cvs -f diff -r v1 -u ) >cvsDiff.out 2>cvs.log &&
test ! -s cvsDiff.out &&
test ! -s cvs.log
'
test_expect_success 'cvs diff -N -r v2 -u' '
- ( cd cvswork &&
- ! cvs -f diff -N -r v2 -u ) >cvsDiff.out 2>cvs.log &&
+ ( cd cvswork && ! cvs -f diff -N -r v2 -u ) >cvsDiff.out 2>cvs.log &&
test ! -s cvs.log &&
test -s cvsDiff.out &&
check_diff cvsDiff.out v2 v1 >check_diff.out 2>&1
'
test_expect_success 'cvs diff -N -r v2 -r v1.2' '
- ( cd cvswork &&
- ! cvs -f diff -N -r v2 -r v1.2 -u ) >cvsDiff.out 2>cvs.log &&
+ ( cd cvswork && ! cvs -f diff -N -r v2 -r v1.2 -u ) >cvsDiff.out 2>cvs.log &&
test ! -s cvs.log &&
test -s cvsDiff.out &&
check_diff cvsDiff.out v2 v1.2 >check_diff.out 2>&1
@@ -484,17 +475,18 @@ test_expect_success 'cvs diff -N -r v2 -r v1.2' '
test_expect_success 'apply early [cvswork3] diff to b3' '
git clone -q . gitwork3 &&
- ( cd gitwork3 &&
+ (
+ cd gitwork3 &&
git checkout -b b3 v1 &&
git apply -p0 --index <"$WORKDIR/cvswork3edit.diff" &&
- git commit -m "cvswork3 edits applied" ) &&
+ git commit -m "cvswork3 edits applied"
+ ) &&
git fetch gitwork3 b3:b3 &&
git tag v3 b3
'
test_expect_success 'check [cvswork3] diff' '
- ( cd cvswork3 &&
- ! cvs -f diff -N -u ) >"$WORKDIR/cvsDiff.out" 2>cvs.log &&
+ ( cd cvswork3 && ! cvs -f diff -N -u ) >"$WORKDIR/cvsDiff.out" 2>cvs.log &&
test ! -s cvs.log &&
test -s cvsDiff.out &&
test $(grep Index: cvsDiff.out | wc -l) = 3 &&
@@ -503,8 +495,7 @@ test_expect_success 'check [cvswork3] diff' '
'
test_expect_success 'merge early [cvswork3] b3 with b1' '
- ( cd gitwork3 &&
- git merge "message" HEAD b1 )
+ ( cd gitwork3 && git merge "message" HEAD b1 ) &&
git fetch gitwork3 b3:b3 &&
git tag v3merged b3 &&
git push --tags gitcvs.git b3:b3
@@ -515,11 +506,13 @@ test_expect_success 'merge early [cvswork3] b3 with b1' '
# TODO: Validate that the .# file was saved properly, and then
# delete/ignore it when checking the tree.
test_expect_success 'cvs up dirty [cvswork3]' '
- ( cd cvswork3 &&
+ (
+ cd cvswork3 &&
cvs -f up &&
- ! cvs -f diff -N -u >"$WORKDIR/cvsDiff.out" ) >cvs.log 2>&1 &&
+ ! cvs -f diff -N -u >"$WORKDIR/cvsDiff.out"
+ ) >cvs.log 2>&1 &&
test -s cvsDiff.out &&
- test $(grep Index: cvsDiff.out | wc -l) = 2
+ test $(grep Index: cvsDiff.out | wc -l) = 2 &&
check_start_tree cvswork3 &&
check_file cvswork3 textfile.c v3merged &&
check_file cvswork3 t3 v3merged &&
@@ -534,8 +527,9 @@ test_expect_success 'cvs up dirty [cvswork3]' '
# TODO: test cvs status
-test_expect_success 'cvs commit [cvswork3' '
- ( cd cvswork3 &&
+test_expect_success 'cvs commit [cvswork3]' '
+ (
+ cd cvswork3 &&
cvs -f commit -m "dirty sandbox after auto-merge"
) >cvs.log 2>&1 &&
check_start_tree cvswork3 &&
--
1.8.0.197.g5a90748
^ permalink raw reply related
* [PATCH 4/8] t9402: No space after IO-redirection
From: Torsten Bögershausen @ 2012-12-08 21:34 UTC (permalink / raw)
To: git; +Cc: tboegi, mmogilvi_git
Redirection should not have SP before the filename
(i.e. ">out", not "> out").
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
t/t9402-git-cvsserver-refs.sh | 60 +++++++++++++++++++++----------------------
1 file changed, 30 insertions(+), 30 deletions(-)
diff --git a/t/t9402-git-cvsserver-refs.sh b/t/t9402-git-cvsserver-refs.sh
index 21000ec..2f63331 100755
--- a/t/t9402-git-cvsserver-refs.sh
+++ b/t/t9402-git-cvsserver-refs.sh
@@ -11,7 +11,7 @@ tags, branches and other git refspecs'
check_start_tree() {
rm -f "$WORKDIR/check.list"
- echo "start $1" >> "${WORKDIR}/check.log"
+ echo "start $1" >>"${WORKDIR}/check.log"
}
check_file() {
@@ -19,11 +19,11 @@ check_file() {
file="$2"
ver="$3"
GIT_DIR=$SERVERDIR git show "${ver}:${file}" \
- > "$WORKDIR/check.got" 2> "$WORKDIR/check.stderr"
+ >"$WORKDIR/check.got" 2>"$WORKDIR/check.stderr"
test_cmp "$WORKDIR/check.got" "$sandbox/$file"
stat=$?
- echo "check_file $sandbox $file $ver : $stat" >> "$WORKDIR/check.log"
- echo "$file" >> "$WORKDIR/check.list"
+ echo "check_file $sandbox $file $ver : $stat" >>"$WORKDIR/check.log"
+ echo "$file" >>"$WORKDIR/check.list"
return $stat
}
@@ -57,7 +57,7 @@ check_diff() {
( cd diffSandbox &&
git checkout "$vOld" &&
git apply -p0 --index <"../$diffFile" &&
- git diff --exit-code "$vNew" ) > check_diff_apply.out 2>&1
+ git diff --exit-code "$vNew" ) >check_diff_apply.out 2>&1
}
#########
@@ -89,18 +89,18 @@ export CVSROOT CVS_SERVER
rm -rf "$CVSWORK" "$SERVERDIR"
test_expect_success 'setup v1, b1' '
- echo "Simple text file" > textfile.c &&
- echo "t2" > t2 &&
+ echo "Simple text file" >textfile.c &&
+ echo "t2" >t2 &&
mkdir adir &&
- echo "adir/afile line1" > adir/afile &&
- echo "adir/afile line2" >> adir/afile &&
- echo "adir/afile line3" >> adir/afile &&
- echo "adir/afile line4" >> adir/afile &&
- echo "adir/a2file" >> adir/a2file &&
+ echo "adir/afile line1" >adir/afile &&
+ echo "adir/afile line2" >>adir/afile &&
+ echo "adir/afile line3" >>adir/afile &&
+ echo "adir/afile line4" >>adir/afile &&
+ echo "adir/a2file" >>adir/a2file &&
mkdir adir/bdir &&
- echo "adir/bdir/bfile line 1" > adir/bdir/bfile &&
- echo "adir/bdir/bfile line 2" >> adir/bdir/bfile &&
- echo "adir/bdir/b2file" > adir/bdir/b2file &&
+ echo "adir/bdir/bfile line 1" >adir/bdir/bfile &&
+ echo "adir/bdir/bfile line 2" >>adir/bdir/bfile &&
+ echo "adir/bdir/b2file" >adir/bdir/b2file &&
git add textfile.c t2 adir &&
git commit -q -m "First Commit (v1)" &&
git tag v1 &&
@@ -152,7 +152,7 @@ test_expect_success 'edit cvswork3 and save diff' '
( cd cvswork3 &&
sed -e "s/line1/line1 - data/" adir/afile >adir/afileNEW &&
mv -f adir/afileNEW adir/afile &&
- echo "afile5" > adir/afile5 &&
+ echo "afile5" >adir/afile5 &&
rm t2 &&
cvs -f add adir/afile5 &&
cvs -f rm t2 &&
@@ -162,17 +162,17 @@ test_expect_success 'edit cvswork3 and save diff' '
test_expect_success 'setup v1.2 on b1' '
git checkout b1 &&
- echo "new v1.2" > t3 &&
+ echo "new v1.2" >t3 &&
rm t2 &&
sed -e "s/line3/line3 - more data/" adir/afile >adir/afileNEW &&
mv -f adir/afileNEW adir/afile &&
rm adir/a2file &&
- echo "a3file" >> adir/a3file &&
- echo "bfile line 3" >> adir/bdir/bfile &&
+ echo "a3file" >>adir/a3file &&
+ echo "bfile line 3" >>adir/bdir/bfile &&
rm adir/bdir/b2file &&
- echo "b3file" > adir/bdir/b3file &&
+ echo "b3file" >adir/bdir/b3file &&
mkdir cdir &&
- echo "cdir/cfile" > cdir/cfile &&
+ echo "cdir/cfile" >cdir/cfile &&
git add -A cdir adir t3 t2 &&
git commit -q -m 'v1.2' &&
git tag v1.2 &&
@@ -280,7 +280,7 @@ test_expect_success 'cvs co b2 [into cvswork2]' '
test_expect_success 'root dir edit [cvswork2]' '
( cd cvswork2 &&
- echo "Line 2" >> textfile.c &&
+ echo "Line 2" >>textfile.c &&
! cvs -f diff -u >"$WORKDIR/cvsEdit1.diff" &&
cvs -f commit -m "edit textfile.c" textfile.c
) >cvsEdit1.log 2>&1
@@ -289,10 +289,10 @@ test_expect_success 'root dir edit [cvswork2]' '
test_expect_success 'root dir rm file [cvswork2]' '
( cd cvswork2 &&
cvs -f rm -f t2 &&
- cvs -f diff -u > ../cvsEdit2-empty.diff &&
+ cvs -f diff -u >../cvsEdit2-empty.diff &&
! cvs -f diff -N -u >"$WORKDIR/cvsEdit2-N.diff" &&
cvs -f commit -m "rm t2"
- ) > cvsEdit2.log 2>&1
+ ) >cvsEdit2.log 2>&1
'
test_expect_success 'subdir edit/add/rm files [cvswork2' '
@@ -302,7 +302,7 @@ test_expect_success 'subdir edit/add/rm files [cvswork2' '
rm adir/bdir/b2file &&
cd adir &&
cvs -f rm bdir/b2file &&
- echo "4th file" > bdir/b4file &&
+ echo "4th file" >bdir/b4file &&
cvs -f add bdir/b4file &&
! cvs -f diff -N -u >"$WORKDIR/cvsEdit3.diff" &&
git fetch gitcvs.git b2:b2 &&
@@ -471,7 +471,7 @@ test_expect_success 'cvs diff -N -r v2 -u' '
! cvs -f diff -N -r v2 -u ) >cvsDiff.out 2>cvs.log &&
test ! -s cvs.log &&
test -s cvsDiff.out &&
- check_diff cvsDiff.out v2 v1 > check_diff.out 2>&1
+ check_diff cvsDiff.out v2 v1 >check_diff.out 2>&1
'
test_expect_success 'cvs diff -N -r v2 -r v1.2' '
@@ -479,7 +479,7 @@ test_expect_success 'cvs diff -N -r v2 -r v1.2' '
! cvs -f diff -N -r v2 -r v1.2 -u ) >cvsDiff.out 2>cvs.log &&
test ! -s cvs.log &&
test -s cvsDiff.out &&
- check_diff cvsDiff.out v2 v1.2 > check_diff.out 2>&1
+ check_diff cvsDiff.out v2 v1.2 >check_diff.out 2>&1
'
test_expect_success 'apply early [cvswork3] diff to b3' '
@@ -499,7 +499,7 @@ test_expect_success 'check [cvswork3] diff' '
test -s cvsDiff.out &&
test $(grep Index: cvsDiff.out | wc -l) = 3 &&
test_cmp cvsDiff.out cvswork3edit.diff &&
- check_diff cvsDiff.out v1 v3 > check_diff.out 2>&1
+ check_diff cvsDiff.out v1 v3 >check_diff.out 2>&1
'
test_expect_success 'merge early [cvswork3] b3 with b1' '
@@ -537,7 +537,7 @@ test_expect_success 'cvs up dirty [cvswork3]' '
test_expect_success 'cvs commit [cvswork3' '
( cd cvswork3 &&
cvs -f commit -m "dirty sandbox after auto-merge"
- ) > cvs.log 2>&1 &&
+ ) >cvs.log 2>&1 &&
check_start_tree cvswork3 &&
check_file cvswork3 textfile.c v3merged &&
check_file cvswork3 t3 v3merged &&
@@ -550,7 +550,7 @@ test_expect_success 'cvs commit [cvswork3' '
check_end_full_tree cvswork3 v3merged &&
git fetch gitcvs.git b3:b4 &&
git tag v4.1 b4 &&
- git diff --exit-code v4.1 v3merged > check_diff_apply.out 2>&1
+ git diff --exit-code v4.1 v3merged >check_diff_apply.out 2>&1
'
test_done
--
1.8.0.197.g5a90748
^ permalink raw reply related
* [PATCH 3/8] t9402: Dont use test_must_fail cvs
From: Torsten Bögershausen @ 2012-12-08 21:34 UTC (permalink / raw)
To: git; +Cc: tboegi, mmogilvi_git
Replace "test_must_fail cvs" with "! cvs"
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
t/t9402-git-cvsserver-refs.sh | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/t/t9402-git-cvsserver-refs.sh b/t/t9402-git-cvsserver-refs.sh
index f1bea0f..21000ec 100755
--- a/t/t9402-git-cvsserver-refs.sh
+++ b/t/t9402-git-cvsserver-refs.sh
@@ -156,7 +156,7 @@ test_expect_success 'edit cvswork3 and save diff' '
rm t2 &&
cvs -f add adir/afile5 &&
cvs -f rm t2 &&
- test_must_fail cvs -f diff -N -u >"$WORKDIR/cvswork3edit.diff"
+ ! cvs -f diff -N -u >"$WORKDIR/cvswork3edit.diff"
)
'
@@ -281,7 +281,7 @@ test_expect_success 'cvs co b2 [into cvswork2]' '
test_expect_success 'root dir edit [cvswork2]' '
( cd cvswork2 &&
echo "Line 2" >> textfile.c &&
- test_must_fail cvs -f diff -u >"$WORKDIR/cvsEdit1.diff" &&
+ ! cvs -f diff -u >"$WORKDIR/cvsEdit1.diff" &&
cvs -f commit -m "edit textfile.c" textfile.c
) >cvsEdit1.log 2>&1
'
@@ -290,7 +290,7 @@ test_expect_success 'root dir rm file [cvswork2]' '
( cd cvswork2 &&
cvs -f rm -f t2 &&
cvs -f diff -u > ../cvsEdit2-empty.diff &&
- test_must_fail cvs -f diff -N -u >"$WORKDIR/cvsEdit2-N.diff" &&
+ ! cvs -f diff -N -u >"$WORKDIR/cvsEdit2-N.diff" &&
cvs -f commit -m "rm t2"
) > cvsEdit2.log 2>&1
'
@@ -304,11 +304,11 @@ test_expect_success 'subdir edit/add/rm files [cvswork2' '
cvs -f rm bdir/b2file &&
echo "4th file" > bdir/b4file &&
cvs -f add bdir/b4file &&
- test_must_fail cvs -f diff -N -u >"$WORKDIR/cvsEdit3.diff" &&
+ ! cvs -f diff -N -u >"$WORKDIR/cvsEdit3.diff" &&
git fetch gitcvs.git b2:b2 &&
( cd .. &&
- test_must_fail cvs -f diff -u -N -r v1.2 >"$WORKDIR/cvsEdit3-v1.2.diff" &&
- test_must_fail cvs -f diff -u -N -r v1.2 -r v1 >"$WORKDIR/cvsEdit3-v1.2-v1.diff"
+ ! cvs -f diff -u -N -r v1.2 >"$WORKDIR/cvsEdit3-v1.2.diff" &&
+ ! cvs -f diff -u -N -r v1.2 -r v1 >"$WORKDIR/cvsEdit3-v1.2-v1.diff"
) &&
cvs -f commit -m "various add/rm/edit"
) >cvs.log 2>&1
@@ -468,7 +468,7 @@ test_expect_success 'cvs diff -r v1 -u' '
test_expect_success 'cvs diff -N -r v2 -u' '
( cd cvswork &&
- test_must_fail cvs -f diff -N -r v2 -u ) >cvsDiff.out 2>cvs.log &&
+ ! cvs -f diff -N -r v2 -u ) >cvsDiff.out 2>cvs.log &&
test ! -s cvs.log &&
test -s cvsDiff.out &&
check_diff cvsDiff.out v2 v1 > check_diff.out 2>&1
@@ -476,7 +476,7 @@ test_expect_success 'cvs diff -N -r v2 -u' '
test_expect_success 'cvs diff -N -r v2 -r v1.2' '
( cd cvswork &&
- test_must_fail cvs -f diff -N -r v2 -r v1.2 -u ) >cvsDiff.out 2>cvs.log &&
+ ! cvs -f diff -N -r v2 -r v1.2 -u ) >cvsDiff.out 2>cvs.log &&
test ! -s cvs.log &&
test -s cvsDiff.out &&
check_diff cvsDiff.out v2 v1.2 > check_diff.out 2>&1
@@ -494,7 +494,7 @@ test_expect_success 'apply early [cvswork3] diff to b3' '
test_expect_success 'check [cvswork3] diff' '
( cd cvswork3 &&
- test_must_fail cvs -f diff -N -u ) >"$WORKDIR/cvsDiff.out" 2>cvs.log &&
+ ! cvs -f diff -N -u ) >"$WORKDIR/cvsDiff.out" 2>cvs.log &&
test ! -s cvs.log &&
test -s cvsDiff.out &&
test $(grep Index: cvsDiff.out | wc -l) = 3 &&
@@ -517,7 +517,7 @@ test_expect_success 'merge early [cvswork3] b3 with b1' '
test_expect_success 'cvs up dirty [cvswork3]' '
( cd cvswork3 &&
cvs -f up &&
- test_must_fail cvs -f diff -N -u >"$WORKDIR/cvsDiff.out" ) >cvs.log 2>&1 &&
+ ! cvs -f diff -N -u >"$WORKDIR/cvsDiff.out" ) >cvs.log 2>&1 &&
test -s cvsDiff.out &&
test $(grep Index: cvsDiff.out | wc -l) = 2
check_start_tree cvswork3 &&
--
1.8.0.197.g5a90748
^ permalink raw reply related
* [PATCH 2/8] t9402: improve check_end_tree() and check_end_full_tree()
From: Torsten Bögershausen @ 2012-12-08 21:33 UTC (permalink / raw)
To: git; +Cc: tboegi, mmogilvi_git
check_end_tree():
- Instead of counting lines using wc in expectCount and cvsCount:
Sort and compare the files byte by byte with test_cmp,
which is more exact and easier to debug
- Chain all shell comands together using &&
check_end_full_tree()
- Instead of counting lines using wc in expectCount, cvsCount and gitCount:
Sort and compare the files byte by byte with test_cmp,
which is more exact and easier to debug
- Break the test using two conditions anded together with -a
into to call to test_cmp
- Chain all shell comands together using &&
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
t/t9402-git-cvsserver-refs.sh | 31 +++++++++++++------------------
1 file changed, 13 insertions(+), 18 deletions(-)
diff --git a/t/t9402-git-cvsserver-refs.sh b/t/t9402-git-cvsserver-refs.sh
index c01748a..f1bea0f 100755
--- a/t/t9402-git-cvsserver-refs.sh
+++ b/t/t9402-git-cvsserver-refs.sh
@@ -28,27 +28,22 @@ check_file() {
}
check_end_tree() {
- sandbox="$1"
- expectCount=$(wc -l < "$WORKDIR/check.list")
- cvsCount=$(find "$sandbox" -name CVS -prune -o -type f -print | wc -l)
- test x"$cvsCount" = x"$expectCount"
- stat=$?
- echo "check_end $sandbox : $stat cvs=$cvsCount expect=$expectCount" \
- >> "$WORKDIR/check.log"
- return $stat
+ sandbox="$1" &&
+ find "$sandbox" -name CVS -prune -o -type f -print >"$WORKDIR/check.cvsCount" &&
+ sort <"$WORKDIR/check.list" >expected &&
+ sort <"$WORKDIR/check.cvsCount" | sed -e "s%cvswork/%%" >actual &&
+ test_cmp expected actual &&
+ rm expected actual
}
check_end_full_tree() {
- sandbox="$1"
- ver="$2"
- expectCount=$(wc -l < "$WORKDIR/check.list")
- cvsCount=$(find "$sandbox" -name CVS -prune -o -type f -print | wc -l)
- gitCount=$(git ls-tree -r "$2" | wc -l)
- test x"$cvsCount" = x"$expectCount" -a x"$gitCount" = x"$expectCount"
- stat=$?
- echo "check_end $sandbox : $stat cvs=$cvsCount git=$gitCount expect=$expectCount" \
- >> "$WORKDIR/check.log"
- return $stat
+ sandbox="$1" &&
+ sort <"$WORKDIR/check.list" >expected &&
+ find "$sandbox" -name CVS -prune -o -type f -print | sed -e "s%$sandbox/%%" | sort >act1 &&
+ test_cmp expected act1 &&
+ git ls-tree -r "$2" | sed -e "s/^.*blob [0-9a-fA-F]*[ ]*//" | sort >act2 &&
+ test_cmp expected act2 &&
+ rm expected act1 act2
}
#########
--
1.8.0.197.g5a90748
^ permalink raw reply related
* [PATCH 1/8] t9402: sed -i is not portable
From: Torsten Bögershausen @ 2012-12-08 21:33 UTC (permalink / raw)
To: git; +Cc: tboegi, mmogilvi_git
On some systems sed allows the usage of e.g.
sed -i -e "s/line1/line2/" afile
to edit the file "in place".
Other systems don't allow that: one observed behaviour is that
sed -i -e "s/line1/line2/" afile
creates a backup file called afile-e, which breaks the test.
As sed -i is not part of POSIX, avoid it.
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
Changes since v2:
Split up into many small commits
The fix of sed -i is the first and most important one
t/t9402-git-cvsserver-refs.sh | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/t/t9402-git-cvsserver-refs.sh b/t/t9402-git-cvsserver-refs.sh
index 858ef0f..c01748a 100755
--- a/t/t9402-git-cvsserver-refs.sh
+++ b/t/t9402-git-cvsserver-refs.sh
@@ -155,7 +155,8 @@ test_expect_success 'cvs co b1 [cvswork3]' '
test_expect_success 'edit cvswork3 and save diff' '
( cd cvswork3 &&
- sed -i -e "s/line1/line1 - data/" adir/afile &&
+ sed -e "s/line1/line1 - data/" adir/afile >adir/afileNEW &&
+ mv -f adir/afileNEW adir/afile &&
echo "afile5" > adir/afile5 &&
rm t2 &&
cvs -f add adir/afile5 &&
@@ -168,7 +169,8 @@ test_expect_success 'setup v1.2 on b1' '
git checkout b1 &&
echo "new v1.2" > t3 &&
rm t2 &&
- sed -i -e "s/line3/line3 - more data/" adir/afile &&
+ sed -e "s/line3/line3 - more data/" adir/afile >adir/afileNEW &&
+ mv -f adir/afileNEW adir/afile &&
rm adir/a2file &&
echo "a3file" >> adir/a3file &&
echo "bfile line 3" >> adir/bdir/bfile &&
@@ -300,7 +302,8 @@ test_expect_success 'root dir rm file [cvswork2]' '
test_expect_success 'subdir edit/add/rm files [cvswork2' '
( cd cvswork2 &&
- sed -i -e "s/line 1/line 1 (v2)/" adir/bdir/bfile &&
+ sed -e "s/line 1/line 1 (v2)/" adir/bdir/bfile >adir/bdir/bfileNEW &&
+ mv -f adir/bdir/bfileNEW adir/bdir/bfile &&
rm adir/bdir/b2file &&
cd adir &&
cvs -f rm bdir/b2file &&
--
1.8.0.197.g5a90748
^ permalink raw reply related
* [PATCHv2] Add directory pattern matching to attributes
From: Jean-Noël AVILA @ 2012-12-08 20:04 UTC (permalink / raw)
To: git
The manpage of gitattributes says: "The rules how the pattern
matches paths are the same as in .gitignore files" and the gitignore
pattern matching has a pattern ending with / for directory matching.
This rule is specifically relevant for the 'export-ignore' rule used
for git archive.
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
---
archive.c | 3 ++-
attr.c | 32 ++++++++++++++++------
t/t5002-archive-attr-pattern.sh | 57 +++++++++++++++++++++++++++++++++++++++
3 files changed, 83 insertions(+), 9 deletions(-)
create mode 100644 t/t5002-archive-attr-pattern.sh
diff --git a/archive.c b/archive.c
index 4666404..93e00bb 100644
--- a/archive.c
+++ b/archive.c
@@ -120,6 +120,8 @@ static int write_archive_entry(const unsigned char *sha1, const char *base,
strbuf_add(&path, args->base, args->baselen);
strbuf_add(&path, base, baselen);
strbuf_addstr(&path, filename);
+ if (S_ISDIR(mode) || S_ISGITLINK(mode))
+ strbuf_addch(&path, '/');
path_without_prefix = path.buf + args->baselen;
setup_archive_check(check);
@@ -130,7 +132,6 @@ static int write_archive_entry(const unsigned char *sha1, const char *base,
}
if (S_ISDIR(mode) || S_ISGITLINK(mode)) {
- strbuf_addch(&path, '/');
if (args->verbose)
fprintf(stderr, "%.*s\n", (int)path.len, path.buf);
err = write_entry(args, sha1, path.buf, path.len, mode);
diff --git a/attr.c b/attr.c
index 097ae87..cdba88a 100644
--- a/attr.c
+++ b/attr.c
@@ -564,17 +564,31 @@ static void bootstrap_attr_stack(void)
attr_stack = elem;
}
+static const char *find_basename(const char *path)
+{
+ char pathbuf[PATH_MAX];
+ int pathlen;
+ const char *cp;
+
+ pathlen =strlen(path);
+ if (path[pathlen-1] != '/') {
+ cp =strrchr(path, '/');
+ return cp ? cp + 1: path;
+ } else {
+ strncpy(pathbuf, path, pathlen);
+ pathbuf[pathlen-1] = '\0';
+ cp =strrchr(pathbuf, '/');
+ return cp ? path + (cp - pathbuf) + 1 : path;
+ }
+}
+
static void prepare_attr_stack(const char *path)
{
struct attr_stack *elem, *info;
int dirlen, len;
const char *cp;
- cp = strrchr(path, '/');
- if (!cp)
- dirlen = 0;
- else
- dirlen = cp - path;
+ dirlen = find_basename(path) - path;
/*
* At the bottom of the attribute stack is the built-in
@@ -668,6 +682,10 @@ static int path_matches(const char *pathname, int pathlen,
const char *pattern = pat->pattern;
int prefix = pat->nowildcardlen;
+ if ((pat->flags & EXC_FLAG_MUSTBEDIR) &&
+ ((!pathlen) || (pathname[pathlen-1] != '/')))
+ return 0;
+
if (pat->flags & EXC_FLAG_NODIR) {
return match_basename(basename,
pathlen - (basename - pathname),
@@ -758,9 +776,7 @@ static void collect_all_attrs(const char *path)
for (i = 0; i < attr_nr; i++)
check_all_attr[i].value = ATTR__UNKNOWN;
- basename = strrchr(path, '/');
- basename = basename ? basename + 1 : path;
-
+ basename = find_basename(path);
pathlen = strlen(path);
rem = attr_nr;
for (stk = attr_stack; 0 < rem && stk; stk = stk->prev)
diff --git a/t/t5002-archive-attr-pattern.sh b/t/t5002-archive-attr-pattern.sh
new file mode 100644
index 0000000..0c847fb
--- /dev/null
+++ b/t/t5002-archive-attr-pattern.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+
+test_description='git archive attribute pattern tests'
+
+. ./test-lib.sh
+
+test_expect_exists() {
+ test_expect_success " $1 exists" "test -e $1"
+}
+
+test_expect_missing() {
+ test_expect_success " $1 does not exist" "test ! -e $1"
+}
+
+test_expect_success 'setup' '
+ echo ignored >ignored &&
+ echo ignored export-ignore >>.git/info/attributes &&
+ git add ignored &&
+
+ mkdir not-ignored-dir &&
+ echo ignored-in-tree >not-ignored-dir/ignored &&
+ echo not-ignored-in-tree >not-ignored-dir/ignored-only-if-dir &&
+ git add not-ignored-dir &&
+
+ mkdir ignored-only-if-dir &&
+ echo ignored by ignored dir >ignored-only-if-dir/ignored-by-ignored-dir &&
+ echo ignored-only-if-dir/ export-ignore >>.git/info/attributes &&
+ git add ignored-only-if-dir &&
+
+
+ mkdir -p one-level-lower/two-levels-lower/ignored-only-if-dir &&
+ echo ignored by ignored dir >one-level-lower/two-levels-lower/ignored-only-if-dir/ignored-by-ignored-dir &&
+ git add one-level-lower &&
+
+ git commit -m. &&
+
+ git clone --bare . bare &&
+ cp .git/info/attributes bare/info/attributes
+'
+
+test_expect_success 'git archive' '
+ git archive HEAD >archive.tar &&
+ (mkdir archive && cd archive && "$TAR" xf -) <archive.tar
+'
+
+test_expect_missing archive/ignored
+test_expect_missing archive/not-ignored-dir/ignored
+test_expect_exists archive/not-ignored-dir/ignored-only-if-dir
+test_expect_exists archive/not-ignored-dir/
+test_expect_missing archive/ignored-only-if-dir/
+test_expect_missing archive/ignored-ony-if-dir/ignored-by-ignored-dir
+test_expect_exists archive/one-level-lower/
+test_expect_missing archive/one-level-lower/two-levels-lower/ignored-only-if-dir/
+test_expect_missing archive/one-level-lower/two-levels-lower/ignored-ony-if-dir/ignored-by-ignored-dir
+
+
+test_done
--
1.7.10.4
^ permalink raw reply related
* [PATCH] shortlog: Fix wrapping lines of wraplen (was broken since recent off-by-one fix)
From: Steffen Prohaska @ 2012-12-08 19:09 UTC (permalink / raw)
To: git, Junio C Hamano; +Cc: Jan H. Schoenherr, Steffen Prohaska
A recent commit [1] fixed a off-by-one wrapping error. As
a side-effect, add_wrapped_shortlog_msg() needs to be changed to always
append a newline.
[1] 14e1a4e1ff70aff36db3f5d2a8b806efd0134d50 utf8: fix off-by-one
wrapping of text
Signed-off-by: Steffen Prohaska <prohaska@zib.de>
---
builtin/shortlog.c | 3 +--
t/t4201-shortlog.sh | 24 ++++++++++++++++++++++++
2 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/builtin/shortlog.c b/builtin/shortlog.c
index b316cf3..db5b57d 100644
--- a/builtin/shortlog.c
+++ b/builtin/shortlog.c
@@ -307,8 +307,7 @@ static void add_wrapped_shortlog_msg(struct strbuf *sb, const char *s,
const struct shortlog *log)
{
int col = strbuf_add_wrapped_text(sb, s, log->in1, log->in2, log->wrap);
- if (col != log->wrap)
- strbuf_addch(sb, '\n');
+ strbuf_addch(sb, '\n');
}
void shortlog_output(struct shortlog *log)
diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh
index 6872ba1..02ac978 100755
--- a/t/t4201-shortlog.sh
+++ b/t/t4201-shortlog.sh
@@ -120,6 +120,30 @@ test_expect_success 'shortlog from non-git directory' '
test_cmp expect out
'
+test_expect_success 'shortlog should add newline when input line matches wraplen' '
+ cat >expect <<\EOF &&
+A U Thor (2):
+ bbbbbbbbbbbbbbbbbb: bbbbbbbb bbb bbbb bbbbbbb bb bbbb bbb bbbbb bbbbbb
+ aaaaaaaaaaaaaaaaaaaaaa: aaaaaa aaaaaaaaaa aaaa aaaaaaaa aa aaaa aa aaa
+
+EOF
+ git shortlog -w >out <<\EOF &&
+commit 0000000000000000000000000000000000000001
+Author: A U Thor <author@example.com>
+Date: Thu Apr 7 15:14:13 2005 -0700
+
+ aaaaaaaaaaaaaaaaaaaaaa: aaaaaa aaaaaaaaaa aaaa aaaaaaaa aa aaaa aa aaa
+
+commit 0000000000000000000000000000000000000002
+Author: A U Thor <author@example.com>
+Date: Thu Apr 7 15:14:13 2005 -0700
+
+ bbbbbbbbbbbbbbbbbb: bbbbbbbb bbb bbbb bbbbbbb bb bbbb bbb bbbbb bbbbbb
+
+EOF
+ test_cmp expect out
+'
+
iconvfromutf8toiso88591() {
printf "%s" "$*" | iconv -f UTF-8 -t ISO8859-1
}
--
1.8.1.rc1.2.gfb98a3a
^ permalink raw reply related
* Re: Feature Request - Hide ignored files before checkout
From: Chris Rorvick @ 2012-12-08 19:21 UTC (permalink / raw)
To: Matthew Ciancio; +Cc: git
In-Reply-To: <000301cdd4dd$f8554090$e8ffc1b0$@gmail.com>
On Fri, Dec 7, 2012 at 6:50 PM, Matthew Ciancio
<matthew.ciancio16@gmail.com> wrote:
> Imagine this scenario:
>
> 1) You have a Git repo with two branches (branchA and branchB), which are
> currently identical.
> 2) Checkout to branch.
> 3) Create file foo.txt, stage it and commit it.
> 4) Create file ignore.txt and add it to the ".gitignore" file of branchB so
> that it is successfully ignored by Git.
> 5) Checkout to branchA.
>
> Problem: ignore.txt does not "disappear" like foo.txt does
When you say "disappear", do you mean "deleted from the file system"
or something else?
> and is now just
> sitting in branchA (and now any other branch I checkout into).
It's not in branchA, it's just no longer ignored because your changes
to .gitignore were effectively reverted by jumping back to the commit
that branchA points to.
> When I first started using Git, I genuinely thought this was a bug, because
> it seems so logical to me that ignore files should hide/reappear just like
> tracked files do, when switching branches.
"hide/reappear" is the equivalent to saying "deleted/created" in the
case of a tracked file in your working tree. But how would Git cause
an untracked file to reappear? By definition, it doesn't know
anything about the file.
> P.S. Here is a forum post I made on StackOverflow about the issue:
> http://stackoverflow.com/questions/13761682/gitignore-hide-ignored-files-dur
> ing-checkout
I posted an answer there, too, but I'm not sure I fully understand the
problem. The top-voted answer doesn't make much sense, though.
Thanks,
Chris
^ permalink raw reply
* [PATCH] gitk: read and write a repository specific configuration file
From: Łukasz Stelmach @ 2012-12-08 11:27 UTC (permalink / raw)
To: git; +Cc: mbranchaud, paulus, gitster, Łukasz Stelmach
In-Reply-To: <50BF6629.8050806@xiplink.com>
Enable gitk read and write repository specific configuration
file: ".git/k" if the file exists. To make gitk use the local
file simply create one, e.g. with the touch(1) command.
This is very useful if one uses different views for different
repositories. Now there is no need to store all of them in
~/.gitk and make the views list needlessly long.
Signed-off-by: Łukasz Stelmach <stlman@poczta.fm>
---
gitk | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/gitk b/gitk
index 379582a..c6b7dc3 100755
--- a/gitk
+++ b/gitk
@@ -2703,7 +2703,7 @@ proc doprogupdate {} {
proc savestuff {w} {
global canv canv2 canv3 mainfont textfont uifont tabstop
- global stuffsaved findmergefiles maxgraphpct
+ global stuffsaved findmergefiles maxgraphpct gitdir
global maxwidth showneartags showlocalchanges
global viewname viewfiles viewargs viewargscmd viewperm nextviewnum
global cmitmode wrapcomment datetimeformat limitdiffs
@@ -2714,10 +2714,12 @@ proc savestuff {w} {
if {$stuffsaved} return
if {![winfo viewable .]} return
catch {
- if {[file exists ~/.gitk-new]} {file delete -force ~/.gitk-new}
- set f [open "~/.gitk-new" w]
+ set fn [expr [file exists [file join $gitdir k]] ? \
+ {[file join $gitdir k-new]} : {"~/.gitk-new"}]
+ if {[file exists $fn]} {file delete -force $fn}
+ set f [open $fn w]
if {$::tcl_platform(platform) eq {windows}} {
- file attributes "~/.gitk-new" -hidden true
+ catch {file attributes "~/.gitk-new" -hidden true}
}
puts $f [list set mainfont $mainfont]
puts $f [list set textfont $textfont]
@@ -2769,7 +2771,7 @@ proc savestuff {w} {
}
puts $f "}"
close $f
- file rename -force "~/.gitk-new" "~/.gitk"
+ file rename -force $fn [regsub {\-new$} $fn {}]
}
set stuffsaved 1
}
@@ -11723,7 +11725,14 @@ namespace import ::msgcat::mc
## And eventually load the actual message catalog
::msgcat::mcload $gitk_msgsdir
+# check that we can find a .git directory somewhere...
+if {[catch {set gitdir [exec git rev-parse --git-dir]}]} {
+ show_error {} . [mc "Cannot find a git repository here."]
+ exit 1
+}
+
catch {source ~/.gitk}
+catch {source [file join $gitdir k]}
parsefont mainfont $mainfont
eval font create mainfont [fontflags mainfont]
@@ -11740,12 +11749,6 @@ setui $uicolor
setoptions
-# check that we can find a .git directory somewhere...
-if {[catch {set gitdir [exec git rev-parse --git-dir]}]} {
- show_error {} . [mc "Cannot find a git repository here."]
- exit 1
-}
-
set selecthead {}
set selectheadid {}
--
1.7.8.6
^ permalink raw reply related
* Re: [PATCH] git(1): remove a defunct link to "list of authors"
From: Jeff King @ 2012-12-08 11:02 UTC (permalink / raw)
To: Shawn Pearce; +Cc: Junio C Hamano, git
In-Reply-To: <CAJo=hJsT+ChAr8vLQ99QPyrCXYAtuEUWn5Wdb-k1brBxk6V45A@mail.gmail.com>
On Fri, Dec 07, 2012 at 01:09:51PM -0800, Shawn O. Pearce wrote:
> On Fri, Dec 7, 2012 at 9:59 AM, Junio C Hamano <gitster@pobox.com> wrote:
> > Junio C Hamano <gitster@pobox.com> writes:
> >
> >> The linked page has not been showing the promised "more complete
> >> list" for more than 6 months by now, and nobody has resurrected
> >> the list there nor elsewhere since then.
> >>
> >> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> >> ---
> >> * If somebody has a working replacement URL, we could use that
> >> instead, of course. Takers?
> >
> > A possible alternative could be https://www.ohloh.net/p/git/contributors/summary
>
> Eh, I think just removing the link is sufficient.
FYI, I just submitted a patch to add a contributors page to git-scm.com
that looks similar to the old one. That patch being the sum total of my
ruby and rails experience, I'd expect some re-working to be necessary
before it is merged:
https://github.com/github/gitscm-next/pull/216
So it probably makes sense to go ahead and drop the link from the
manpage for now, and we can re-add it if the contributors page gets
merged (in my patch, it has a different path, so we would need to tweak
the URL eventually anyway).
-Peff
^ permalink raw reply
* Re: [PATCH] sh-setup: work around "unset IFS" bug in some shells
From: Andreas Schwab @ 2012-12-08 9:25 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Marc Branchaud, Git Mailing List
In-Reply-To: <7v624dfp1e.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> Andreas Schwab <schwab@linux-m68k.org> writes:
>
>> Junio C Hamano <gitster@pobox.com> writes:
>>
>>> +# Similarly for IFS, but some shells (e.g. FreeBSD 7.2) are buggy and
>>> +# do not equate an unset IFS with IFS with the default, so here is
>>> +# an explicit SP HT LF.
>>> +IFS='
>>> +'
>>
>> Trailing whitespace can easily get lost
>
> The comment above the assingment spell the character names out for
> that exact reason. Honestly, I think
That won't help if you don't look for it. The loss can easily happen
while you are in a different part of the file.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply
* [PATCH v2] cache-tree: invalidate i-t-a paths after generating trees
From: Nguyễn Thái Ngọc Duy @ 2012-12-08 4:10 UTC (permalink / raw)
To: git
Cc: Jeff King, Junio C Hamano, Jonathon Mah,
Nguyễn Thái Ngọc Duy
In-Reply-To: <1352459040-14452-1-git-send-email-pclouds@gmail.com>
Intent-to-add entries used to forbid writing trees so it was not a
problem. After commit 3f6d56d (commit: ignore intent-to-add entries
instead of refusing - 2012-02-07), we can generate trees from an index
with i-t-a entries.
However, the commit forgets to invalidate all paths leading to i-t-a
entries. With fully valid cache-tree (e.g. after commit or
write-tree), diff operations may prefer cache-tree to index and not
see i-t-a entries in the index, because cache-tree does not have them.
Reported-by: Jonathon Mah <me@JonathonMah.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
Sorry for the late update, I have little time for git these days.
It turns out that we don't need phony bit and another round for
invalidation. We can do it in update_one.
cache-tree.c | 30 ++++++++++++++++++++++++++----
t/t2203-add-intent.sh | 20 ++++++++++++++++++++
2 files changed, 46 insertions(+), 4 deletions(-)
diff --git a/cache-tree.c b/cache-tree.c
index 28ed657..989a7ff 100644
--- a/cache-tree.c
+++ b/cache-tree.c
@@ -248,6 +248,7 @@ static int update_one(struct cache_tree *it,
int missing_ok = flags & WRITE_TREE_MISSING_OK;
int dryrun = flags & WRITE_TREE_DRY_RUN;
int i;
+ int to_invalidate = 0;
if (0 <= it->entry_count && has_sha1_file(it->sha1))
return it->entry_count;
@@ -324,7 +325,13 @@ static int update_one(struct cache_tree *it,
if (!sub)
die("cache-tree.c: '%.*s' in '%s' not found",
entlen, path + baselen, path);
- i += sub->cache_tree->entry_count - 1;
+ i--; /* this entry is already counted in "sub" */
+ if (sub->cache_tree->entry_count < 0) {
+ i -= sub->cache_tree->entry_count;
+ to_invalidate = 1;
+ }
+ else
+ i += sub->cache_tree->entry_count;
sha1 = sub->cache_tree->sha1;
mode = S_IFDIR;
}
@@ -339,8 +346,23 @@ static int update_one(struct cache_tree *it,
mode, sha1_to_hex(sha1), entlen+baselen, path);
}
- if (ce->ce_flags & (CE_REMOVE | CE_INTENT_TO_ADD))
- continue; /* entry being removed or placeholder */
+ /*
+ * CE_REMOVE entries are removed before the index is
+ * written to disk. Skip them to remain consistent
+ * with the future on-disk index.
+ */
+ if (ce->ce_flags & CE_REMOVE)
+ continue;
+
+ /*
+ * CE_INTENT_TO_ADD entries exist on on-disk index but
+ * they are not part of generated trees. Invalidate up
+ * to root to force cache-tree users to read elsewhere.
+ */
+ if (ce->ce_flags & CE_INTENT_TO_ADD) {
+ to_invalidate = 1;
+ continue;
+ }
strbuf_grow(&buffer, entlen + 100);
strbuf_addf(&buffer, "%o %.*s%c", mode, entlen, path + baselen, '\0');
@@ -360,7 +382,7 @@ static int update_one(struct cache_tree *it,
}
strbuf_release(&buffer);
- it->entry_count = i;
+ it->entry_count = to_invalidate ? -i : i;
#if DEBUG
fprintf(stderr, "cache-tree update-one (%d ent, %d subtree) %s\n",
it->entry_count, it->subtree_nr,
diff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh
index ec35409..2a4a749 100755
--- a/t/t2203-add-intent.sh
+++ b/t/t2203-add-intent.sh
@@ -62,5 +62,25 @@ test_expect_success 'can "commit -a" with an i-t-a entry' '
git commit -a -m all
'
+test_expect_success 'cache-tree invalidates i-t-a paths' '
+ git reset --hard &&
+ mkdir dir &&
+ : >dir/foo &&
+ git add dir/foo &&
+ git commit -m foo &&
+
+ : >dir/bar &&
+ git add -N dir/bar &&
+ git diff --cached --name-only >actual &&
+ echo dir/bar >expect &&
+ test_cmp expect actual &&
+
+ git write-tree >/dev/null &&
+
+ git diff --cached --name-only >actual &&
+ echo dir/bar >expect &&
+ test_cmp expect actual
+'
+
test_done
--
1.8.0.rc2.23.g1fb49df
^ permalink raw reply related
* Feature Request - Hide ignored files before checkout
From: Matthew Ciancio @ 2012-12-08 0:50 UTC (permalink / raw)
To: git
To whom it may concern,
I am not sure if this is the right place to send this, but I couldn't find
anything on the web that seemed official, so here goes.
Imagine this scenario:
1) You have a Git repo with two branches (branchA and branchB), which are
currently identical.
2) Checkout to branch.
3) Create file foo.txt, stage it and commit it.
4) Create file ignore.txt and add it to the ".gitignore" file of branchB so
that it is successfully ignored by Git.
5) Checkout to branchA.
Problem: ignore.txt does not "disappear" like foo.txt does and is now just
sitting in branchA (and now any other branch I checkout into).
When I first started using Git, I genuinely thought this was a bug, because
it seems so logical to me that ignore files should hide/reappear just like
tracked files do, when switching branches.
I have been told ways of circumventing this (using commits and un-commits OR
using stash), but my reason for avoiding commits is: say you have binary/OS
specific files which really do not belong in the commit logs (even locally)
and hence should be ignored. What if you want those files in only one branch
and not all?
Stashing doesn't seem appropriate either, because it would get messy.
Do you think this warrants a feature request?
If so, I was thinking that maybe the .gitignore file could have a flag after
each entry, to indicate whether the file(s)/folder(s) should have this new
feature or not (that way it would cater for everyone, but I can't see why
you wouldn't want this behaviour).
If you like this idea and submit this as a feature request, please respond
with a link of the official request so that I can follow it, or provide me
with a link to submit it myself.
P.S. Here is a forum post I made on StackOverflow about the issue:
http://stackoverflow.com/questions/13761682/gitignore-hide-ignored-files-dur
ing-checkout
Kind regards,
Matt
^ permalink raw reply
* [PATCH] shortlog: add --format to the usage
From: yannicklm @ 2012-12-08 0:46 UTC (permalink / raw)
To: git; +Cc: yannicklm
---
builtin/shortlog.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/shortlog.c b/builtin/shortlog.c
index b316cf3..cb85ede 100644
--- a/builtin/shortlog.c
+++ b/builtin/shortlog.c
@@ -10,7 +10,7 @@
#include "parse-options.h"
static char const * const shortlog_usage[] = {
- N_("git shortlog [-n] [-s] [-e] [-w] [rev-opts] [--] [<commit-id>... ]"),
+ N_("git shortlog [-n] [-s] [-e] [-w] [--format=...] [rev-opts] [--] [<commit-id>... ]"),
"",
N_("[rev-opts] are documented in git-rev-list(1)"),
NULL
--
1.8.0.1
^ permalink raw reply related
* [ANNOUNCE] Git v1.8.1-rc1
From: Junio C Hamano @ 2012-12-08 0:20 UTC (permalink / raw)
To: git; +Cc: Linux Kernel
A release candidate Git v1.8.1-rc1 is now available for testing
at the usual places.
The release tarballs are found at:
http://code.google.com/p/git-core/downloads/list
and their SHA-1 checksums are:
4b451bb5b7125349c35cf15118e8f1893569e48f git-1.8.1.rc1.tar.gz
7416b28a0917fef26ca06f22bc493ebea371267f git-htmldocs-1.8.1.rc1.tar.gz
b5758adf5814d64ee8e0d26bdfb919be1c605071 git-manpages-1.8.1.rc1.tar.gz
Also the following public repositories all have a copy of the v1.8.1-rc1
tag and the master branch that the tag points at:
url = git://repo.or.cz/alt-git.git
url = https://code.google.com/p/git-core/
url = git://git.sourceforge.jp/gitroot/git-core/git.git
url = git://git-core.git.sourceforge.net/gitroot/git-core/git-core
url = https://github.com/gitster/git
Git v1.8.1 Release Notes (draft)
========================
Backward compatibility notes
----------------------------
In the next major release (not *this* one), we will change the
behavior of the "git push" command.
When "git push [$there]" does not say what to push, we have used the
traditional "matching" semantics so far (all your branches were sent
to the remote as long as there already are branches of the same name
over there). We will use the "simple" semantics that pushes the
current branch to the branch with the same name, only when the current
branch is set to integrate with that remote branch. There is a user
preference configuration variable "push.default" to change this, and
"git push" will warn about the upcoming change until you set this
variable in this release.
"git branch --set-upstream" is deprecated and may be removed in a
relatively distant future. "git branch [-u|--set-upstream-to]" has
been introduced with a saner order of arguments to replace it.
Updates since v1.8.0
--------------------
UI, Workflows & Features
* Command-line completion scripts for tcsh and zsh have been added.
* A new remote-helper interface for Mercurial has been added to
contrib/remote-helpers.
* We used to have a workaround for a bug in ancient "less" that
causes it to exit without any output when the terminal is resized.
The bug has been fixed in "less" version 406 (June 2007), and the
workaround has been removed in this release.
* Some documentation pages that used to ship only in the plain text
format are now formatted in HTML as well.
* "git-prompt" scriptlet (in contrib/completion) can be told to paint
pieces of the hints in the prompt string in colors.
* A new configuration variable "diff.context" can be used to
give the default number of context lines in the patch output, to
override the hardcoded default of 3 lines.
* When "git checkout" checks out a branch, it tells the user how far
behind (or ahead) the new branch is relative to the remote tracking
branch it builds upon. The message now also advises how to sync
them up by pushing or pulling. This can be disabled with the
advice.statusHints configuration variable.
* "git config --get" used to diagnose presence of multiple
definitions of the same variable in the same configuration file as
an error, but it now applies the "last one wins" rule used by the
internal configuration logic. Strictly speaking, this may be an
API regression but it is expected that nobody will notice it in
practice.
* "git log -p -S<string>" now looks for the <string> after applying
the textconv filter (if defined); earlier it inspected the contents
of the blobs without filtering.
* "git format-patch" learned the "--notes=<ref>" option to give
notes for the commit after the three-dash lines in its output.
* "git log --grep=<pcre>" learned to honor the "grep.patterntype"
configuration set to "perl".
* "git replace -d <object>" now interprets <object> as an extended
SHA-1 (e.g. HEAD~4 is allowed), instead of only accepting full hex
object name.
* "git rm $submodule" used to punt on removing a submodule working
tree to avoid losing the repository embedded in it. Because
recent git uses a mechanism to separate the submodule repository
from the submodule working tree, "git rm" learned to detect this
case and removes the submodule working tree when it is safe to do so.
* "git send-email" used to prompt for the sender address, even when
the committer identity is well specified (e.g. via user.name and
user.email configuration variables). The command no longer gives
this prompt when not necessary.
* "git send-email" did not allow non-address garbage strings to
appear after addresses on Cc: lines in the patch files (and when
told to pick them up to find more recipients), e.g.
Cc: Stable Kernel <stable@k.org> # for v3.2 and up
The command now strips " # for v3.2 and up" part before adding the
remainder of this line to the list of recipients.
* "git submodule add" learned to add a new submodule at the same
path as the path where an unrelated submodule was bound to in an
existing revision via the "--name" option.
* "git submodule sync" learned the "--recursive" option.
* "diff.submodule" configuration variable can be used to give custom
default value to the "git diff --submodule" option.
* "git symbolic-ref" learned the "-d $symref" option to delete the
named symbolic ref, which is more intuitive way to spell it than
"update-ref -d --no-deref $symref".
Foreign Interface
* "git cvsimport" can be told to record timezones (other than GMT)
per-author via its author info file.
* The remote helper interface to interact with subversion
repositories (one of the GSoC 2012 projects) has been merged.
Performance, Internal Implementation, etc.
* Compilation on Cygwin with newer header files are supported now.
* The logic to generate the initial advertisement from "upload-pack"
(i.e. what is invoked by "git fetch" on the other side of the
connection) to list what refs are available in the repository has
been optimized.
* The logic to find set of attributes that match a given path has
been optimized.
* Use preloadindex in "git diff-index" and "git update-index", which
has a nice speedup on systems with slow stat calls (and even on
Linux).
Also contains minor documentation updates and code clean-ups.
Fixes since v1.8.0
------------------
Unless otherwise noted, all the fixes since v1.8.0 in the maintenance
track are contained in this release (see release notes to them for
details).
* The configuration parser had an unnecessary hardcoded limit on
variable names that was not checked consistently.
* The "say" function in the test scaffolding incorrectly allowed
"echo" to interpret "\a" as if it were a C-string asking for a
BEL output.
* "git mergetool" feeds /dev/null as a common ancestor when dealing
with an add/add conflict, but p4merge backend cannot handle
it. Work it around by passing a temporary empty file.
* "git log -F -E --grep='<ere>'" failed to use the given <ere>
pattern as extended regular expression, and instead looked for the
string literally.
* "git grep -e pattern <tree>" asked the attribute system to read
"<tree>:.gitattributes" file in the working tree, which was
nonsense.
* A symbolic ref refs/heads/SYM was not correctly removed with "git
branch -d SYM"; the command removed the ref pointed by SYM
instead.
* Update "remote tracking branch" in the documentation to
"remote-tracking branch".
* "git pull --rebase" run while the HEAD is detached tried to find
the upstream branch of the detached HEAD (which by definition
does not exist) and emitted unnecessary error messages.
* The refs/replace hierarchy was not mentioned in the
repository-layout docs.
* Various rfc2047 quoting issues around a non-ASCII name on the
From: line in the output from format-patch have been corrected.
* Sometimes curl_multi_timeout() function suggested a wrong timeout
value when there is no file descriptor to wait on and the http
transport ended up sleeping for minutes in select(2) system call.
A workaround has been added for this.
* For a fetch refspec (or the result of applying wildcard on one),
we always want the RHS to map to something inside "refs/"
hierarchy, but the logic to check it was not exactly right.
(merge 5c08c1f jc/maint-fetch-tighten-refname-check later to maint).
* "git diff -G<pattern>" did not honor textconv filter when looking
for changes.
* Some HTTP servers ask for auth only during the actual packing phase
(not in ls-remote phase); this is not really a recommended
configuration, but the clients used to fail to authenticate with
such servers.
(merge 2e736fd jk/maint-http-half-auth-fetch later to maint).
* "git p4" used to try expanding malformed "$keyword$" that spans
across multiple lines.
* Syntax highlighting in "gitweb" was not quite working.
* RSS feed from "gitweb" had a xss hole in its title output.
* "git config --path $key" segfaulted on "[section] key" (a boolean
"true" spelled without "=", not "[section] key = true").
* "git checkout -b foo" while on an unborn branch did not say
"Switched to a new branch 'foo'" like other cases.
* Various codepaths have workaround for a common misconfiguration to
spell "UTF-8" as "utf8", but it was not used uniformly. Most
notably, mailinfo (which is used by "git am") lacked this support.
* We failed to mention a file without any content change but whose
permission bit was modified, or (worse yet) a new file without any
content in the "git diff --stat" output.
* When "--stat-count" hides a diffstat for binary contents, the total
number of added and removed lines at the bottom was computed
incorrectly.
* When "--stat-count" hides a diffstat for unmerged paths, the total
number of affected files at the bottom of the "diff --stat" output
was computed incorrectly.
* "diff --shortstat" miscounted the total number of affected files
when there were unmerged paths.
* "update-ref -d --deref SYM" to delete a ref through a symbolic ref
that points to it did not remove it correctly.
----------------------------------------------------------------
Changes since v1.8.1-rc0 are as follows:
Jiang Xin (1):
l10n: Update git.pot (5 new, 1 removed messages)
Junio C Hamano (3):
Update draft release notes to 1.8.0.2
Documentation/diff-config: work around AsciiDoc misfortune
Git 1.8.1-rc1
Matthieu Moy (1):
document that statusHints affects git checkout
Peter Krefting (1):
l10n: Update Swedish translation (1979t0f0u)
Ralf Thielow (2):
l10n: de.po: translate 825 new messages
l10n: de.po: translate 22 new messages
Ramkumar Ramachandra (4):
t4041 (diff-submodule-option): don't hardcode SHA-1 in expected outputs
t4041 (diff-submodule-option): parse digests sensibly
t4041 (diff-submodule-option): rewrite add_file() routine
t4041 (diff-submodule-option): modernize style
Tran Ngoc Quan (1):
l10n: vi.po: update to git-v1.8.0.1-347-gf94c3
^ permalink raw reply
* [PATCH] Documentation/diff-config: work around AsciiDoc misfortune
From: Junio C Hamano @ 2012-12-07 23:34 UTC (permalink / raw)
To: git
The line that happens to begin with indent followed by "3. " was
interpreted as if it were an enumerated list; just wrap the lines
differently to work it around for now.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
* The last section of Documentation/technical/api-command.txt has a
related/similar issue in that AsciiDoc wants to renumber them
starting from 1 not from 0, as all humans do, but the result is
more desirable. I'll leave a patch to renumber them in the
source to others, as I am busy cutting the 1.8.1-rc1 today.
But "3" in this one is not the beginning of an enumerated item;
it is cardinal (i.e. counting), not ordinal, and needs to be
corrected before the final release.
Documentation/diff-config.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt
index 89dd634..4314ad0 100644
--- a/Documentation/diff-config.txt
+++ b/Documentation/diff-config.txt
@@ -57,8 +57,8 @@ diff.statGraphWidth::
to all commands generating --stat output except format-patch.
diff.context::
- Generate diffs with <n> lines of context instead of the default of
- 3. This value is overridden by the -U option.
+ Generate diffs with <n> lines of context instead of the default
+ of 3. This value is overridden by the -U option.
diff.external::
If this config variable is set, diff generation is not
--
1.8.1.rc1.123.gb624e49
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox