* Re: git log -p file.c
From: Jakub Narebski @ 2007-06-14 21:55 UTC (permalink / raw)
To: git
In-Reply-To: <20070614090217.GA8271@informatik.uni-freiburg.de>
[Cc: git@vger.kernel.org]
Uwe Kleine-Koenig wrote:
> when I run
>
> git log -p file.c
>
> I don't get the complete change a commit introduces but only how file.c
> changed. This is kind of surprising for me, I had expected to get the
> whole diff.
Try unfortunately _undocumented_ --full-diff option to git-log.
git log -p --full-diff -- file.c
(the --full-diff option was introduced in commit-477f2b41 without adding
appropriate info to Documentation/git-log.txt)
> And is it intended that (clean) merges are shown?
Path limiting simplifies history, and might linearize it (i.e. merges
become non-merges).
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: [StGIT PATCH 2/4] Abstract a PatchSet object out of Series.
From: Catalin Marinas @ 2007-06-14 22:56 UTC (permalink / raw)
To: Yann Dirson; +Cc: git
In-Reply-To: <20070613203821.GQ6992@nan92-1-81-57-214-146.fbx.proxad.net>
On 13/06/07, Yann Dirson <ydirson@altern.org> wrote:
> I have started to work on a Hydra class (available at [1], but be
> aware it doesn't do much more than creating an octopus, and breaking
> many current StGIT assumptions), with a testcase to demonstrate its
> use), which binds together a set of stacks with an octopus, to allow
> keeping related patches together, and allow people to pull from one
> topic stack without getting unrelated work.
If it works, it would be really useful. Do the stacks need to be
independent? I can group my patches easily (and I was thinking about
"collapse/expand" commands for better viewing) but one stack might
still depend on patches from a different one. It would be nice if one
could also set the base of a series in this kind of hydra structure
(unless it makes it difficult to understand).
> > The HEAD in my repository fails the test suite. Do you have any
> > additional patches pending (some patches were not applied in order as
> > I had to manually fix the conflicts). Anyway, please check my
> > repository for any missing patches.
>
> Oh, I had not noticed you had applied
> bd69feaf7c3c94b6e7e216ea8091064af9cdfa97. Sorry, I was not explicit
> enough when posing this, only the cover mail included "RFC" in the
> subject.
OK, they were left as unread in my inbox and thought they were new.
> As described in that mail, there are problems both with the
> original approach (Karl's test failing), and with that new one (that
> exisiting test failing).
>
> Do you have any idea on how we could overcome the problem ? In the
> meantime, we could possibly just comment that testcase out (or add
> support for continuing the testsuite even with a failure) - the
> problem it exhibits is probably less common than the one that was
> fixed.
I am happy with only 2 modes - one using ORIG_HEAD for people using
StGIT in combination with plain GIT and the other overriding the base
without checks. The second mode is for people not mixing StGIT with
plain GIT. For the first mode, they have to deal with conflicts as
with the standard GIT.
> BTW, a02ba4077f12578fe31c99d903488804a656e1c4 has a slight problem: it
> is a patch by Karl, which I re-sent in the same group since it was
> exhibiting the problem (and with the intent of adding a signed-off-by
> line, but my way of adding them trough a buggy template showed its
> limits and the commit now have 2 signed-off-by lines with Karl's
> name). However, it was applied with myself as author, which is quite
> wrong: could that be a but in "stg import" ignoring the Author field ?
It's not a bug. The import command just uses the e-mail sender or a
"From:" line before the patch description (see the default mail
template). It doesn't check the sign lines (it is following the kernel
patch submission guidelines).
I would drop both the above commits for release 0.13. Are you OK with this?
--
Catalin
^ permalink raw reply
* StGIT vs. guilt: What's the difference?
From: Steven Grimm @ 2007-06-14 21:55 UTC (permalink / raw)
To: 'git'
I've asked this on IRC a couple times and nobody seemed to have a good
answer, so: These two tools seem like they are solving the same general
problem using similar approaches. They are both under active
development. In what areas is each of them stronger than the other? Why
would one choose to use one of them instead of the other?
-Steve
^ permalink raw reply
* Re: git-p4import.py robustness changes
From: Simon Hausmann @ 2007-06-14 21:44 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: Junio C Hamano, git
In-Reply-To: <20070614053538.GA6073@spearce.org>
[-- Attachment #1: Type: text/plain, Size: 3009 bytes --]
On Thursday 14 June 2007 07:35:38 Shawn O. Pearce wrote:
> Simon Hausmann <simon@lst.de> wrote:
> > I've used git-filter-branch to rewrite the history in fast-export to
> > include only changes relevant to git-p4 and at the same time move all
> > files into contrib/fast-import. The result is available as separate
> > branch at
> >
> > git://repo.or.cz/fast-export.git git-p4
> >
> > and technically merges fine into git.git's contrib/fast-import directory
> > with three files (git-p4, git-p4.txt and git-p4.bat for windows
> > convenience).
> >
> > Please let me know if there's anything missing or if you prefer a
> > different format or so. I also realized that I haven't really used the
> > 'Signed-off-by' tags in the past but I'd be happy to adopt it for git
> > inclusion if you prefer that :)
>
> Yes. The SBO line is your assertion that you own the rights to the
> code and can release it under the license you are offering it under.
> One of the issues I have with this git-p4 history you have built
> is the lack of the SBO line on all 255 commits.
>
> Of course an SBO line doesn't carry that much weight, its just a line
> after all, but according to Git's project standards it should be there
> if you are agreeing to release it. See Documentation/SubmittingPatches
> for details.
>
> My other problem with this history is a commit like b79112 "a
> little bit more convenience" (and there are many such commits).
> This message is insanely short, doesn't really talk at all about
> what a little bit is, how it is more convenient, or who it is more
> convenient for.
>
> Think about how that oneline (and the others) would look in Junio's
> "What's new in git.git" emails, or in gitweb. There is not enough
> detail here to be of any value to the reader. Expanding out to the
> full message offers nothing additional either, because that is all
> there is in the entire commit message body.
>
> I do appreciate you taking the time to use filter-branch to try to
> cleanup this history a bit. I really had originally planned on
> pulling your tree through to my fastimport tree and then talking
> Junio into merging with me. But after reading through this history I
> don't want do that, because of the oneline summaries I just pointed
> out above, and because of the missing SBO.
First of all thanks for looking at the branch. I agree with your concerns and
I do admit that I've been a bit too sloppy with the log messages.
I have started cleaning up the history even more by reworking the log messages
of my commits (git-p4-enhanced-logs branch in fast-export, starting at the
last page). Once that is done (I expect that to take a few days) I'll add the
missing SOB lines with git-filter-branch and see if I can get an agreement
from Han-Wen and Marius for doing the same with their commits (adding the
missing lines).
Would you be willing to reevaluate the situation regarding a merge once that's
done?
Simon
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: StGIT rebasing safeguard
From: Yann Dirson @ 2007-06-14 21:30 UTC (permalink / raw)
To: Catalin Marinas; +Cc: git
In-Reply-To: <20070613203821.GQ6992@nan92-1-81-57-214-146.fbx.proxad.net>
On Wed, Jun 13, 2007 at 10:38:21PM +0200, Yann Dirson wrote:
> > The HEAD in my repository fails the test suite. Do you have any
> > additional patches pending (some patches were not applied in order as
> > I had to manually fix the conflicts). Anyway, please check my
> > repository for any missing patches.
>
> Oh, I had not noticed you had applied
> bd69feaf7c3c94b6e7e216ea8091064af9cdfa97. Sorry, I was not explicit
> enough when posing this, only the cover mail included "RFC" in the
> subject. As described in that mail, there are problems both with the
> original approach (Karl's test failing), and with that new one (that
> exisiting test failing).
>
> Do you have any idea on how we could overcome the problem ? In the
> meantime, we could possibly just comment that testcase out (or add
> support for continuing the testsuite even with a failure) - the
> problem it exhibits is probably less common than the one that was
> fixed.
Well, the patch I just sent which adds GIT_SKIP_TESTS support allows
to see that this patch indeed breaks another test - the testsuite can
be forced to skip them [1] for the sake of checking one did not break
anything else, but the second test that does not pass is annoying as
well, due to a similar problem:
When the parent branch is a rewinding one (eg. an stgit stack), then
the old version of the patch will be turned to unreachable by
pull/rebase, and we probably have even no way of telling stgit that it
is indeed expected, since the parent stack is a local one. My own
workflow on StGIT is affected by the issue, since my "bugs" stack is
forked off my "master" stack (but hopefully an hydra will help me ;).
That makes me suspecting the reachability approach is a dead-end, and
we should either get back to the approach of recording old-base, or
find another solution.
Best regards,
--
Yann
[1] GIT_SKIP_TESTS='t2100.4 t2102.3' make test
^ permalink raw reply
* [StGIT PATCH] Update test-lib.sh from current git.
From: Yann Dirson @ 2007-06-14 21:15 UTC (permalink / raw)
To: Catalin Marinas; +Cc: git
Updated with changes to git up to rev
664368886781b7c070233c002597b84628eec571, including:
* GIT_SKIP_TESTS support, useful to run the testsuite bypassing tests
known to fail
* test_tick utility function to forge realistic commit dates
* deprecation of git-init-db in favor of git-init
* more environment safety cleanups
Signed-off-by: Yann Dirson <ydirson@altern.org>
---
t/test-lib.sh | 128 ++++++++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 107 insertions(+), 21 deletions(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
old mode 100755
new mode 100644
index d50a3ba..4bb00fb
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -10,11 +10,14 @@ LC_ALL=C
PAGER=cat
TZ=UTC
export LANG LC_ALL PAGER TZ
+EDITOR=:
+VISUAL=:
unset AUTHOR_DATE
unset AUTHOR_EMAIL
unset AUTHOR_NAME
unset COMMIT_AUTHOR_EMAIL
unset COMMIT_AUTHOR_NAME
+unset EMAIL
unset GIT_ALTERNATE_OBJECT_DIRECTORIES
unset GIT_AUTHOR_DATE
#GIT_AUTHOR_EMAIL=author@example.com
@@ -29,8 +32,24 @@ unset GIT_INDEX_FILE
unset GIT_OBJECT_DIRECTORY
unset SHA1_FILE_DIRECTORIES
unset SHA1_FILE_DIRECTORY
+GIT_MERGE_VERBOSITY=5
+export GIT_MERGE_VERBOSITY
export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME
export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
+export EDITOR VISUAL
+
+# Protect ourselves from common misconfiguration to export
+# CDPATH into the environment
+unset CDPATH
+
+case $(echo $GIT_TRACE |tr "[A-Z]" "[a-z]") in
+ 1|2|true)
+ echo "* warning: Some tests will not work if GIT_TRACE" \
+ "is set as to trace on STDERR ! *"
+ echo "* warning: Please set GIT_TRACE to something" \
+ "other than 1, 2 or true ! *"
+ ;;
+esac
# Each test should start with something like this, after copyright notices:
#
@@ -83,6 +102,17 @@ test_count=0
trap 'echo >&5 "FATAL: Unexpected exit with code $?"; exit 1' exit
+test_tick () {
+ if test -z "${test_tick+set}"
+ then
+ test_tick=1112911993
+ else
+ test_tick=$(($test_tick + 60))
+ fi
+ GIT_COMMITTER_DATE="$test_tick -0700"
+ GIT_AUTHOR_DATE="$test_tick -0700"
+ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
+}
# You are not expected to call test_ok_ and test_failure_ directly, use
# the text_expect_* functions instead.
@@ -112,43 +142,79 @@ test_run_ () {
return 0
}
+test_skip () {
+ this_test=$(expr "./$0" : '.*/\(t[0-9]*\)-[^/]*$')
+ this_test="$this_test.$(expr "$test_count" + 1)"
+ to_skip=
+ for skp in $GIT_SKIP_TESTS
+ do
+ case "$this_test" in
+ $skp)
+ to_skip=t
+ esac
+ done
+ case "$to_skip" in
+ t)
+ say >&3 "skipping test: $@"
+ test_count=$(expr "$test_count" + 1)
+ say "skip $test_count: $1"
+ : true
+ ;;
+ *)
+ false
+ ;;
+ esac
+}
+
test_expect_failure () {
test "$#" = 2 ||
error "bug in the test script: not 2 parameters to test-expect-failure"
- say >&3 "expecting failure: $2"
- test_run_ "$2"
- if [ "$?" = 0 -a "$eval_ret" != 0 ]
+ if ! test_skip "$@"
then
- test_ok_ "$1"
- else
- test_failure_ "$@"
+ say >&3 "expecting failure: $2"
+ test_run_ "$2"
+ if [ "$?" = 0 -a "$eval_ret" != 0 -a "$eval_ret" -lt 129 ]
+ then
+ test_ok_ "$1"
+ else
+ test_failure_ "$@"
+ fi
fi
+ echo >&3 ""
}
test_expect_success () {
test "$#" = 2 ||
error "bug in the test script: not 2 parameters to test-expect-success"
- say >&3 "expecting success: $2"
- test_run_ "$2"
- if [ "$?" = 0 -a "$eval_ret" = 0 ]
+ if ! test_skip "$@"
then
- test_ok_ "$1"
- else
- test_failure_ "$@"
+ say >&3 "expecting success: $2"
+ test_run_ "$2"
+ if [ "$?" = 0 -a "$eval_ret" = 0 ]
+ then
+ test_ok_ "$1"
+ else
+ test_failure_ "$@"
+ fi
fi
+ echo >&3 ""
}
test_expect_code () {
test "$#" = 3 ||
error "bug in the test script: not 3 parameters to test-expect-code"
- say >&3 "expecting exit code $1: $3"
- test_run_ "$3"
- if [ "$?" = 0 -a "$eval_ret" = "$1" ]
+ if ! test_skip "$@"
then
- test_ok_ "$2"
- else
- test_failure_ "$@"
+ say >&3 "expecting exit code $1: $3"
+ test_run_ "$3"
+ if [ "$?" = 0 -a "$eval_ret" = "$1" ]
+ then
+ test_ok_ "$2"
+ else
+ test_failure_ "$@"
+ fi
fi
+ echo >&3 ""
}
# Most tests can use the created repository, but some amy need to create more.
@@ -160,8 +226,8 @@ test_create_repo () {
repo="$1"
mkdir "$repo"
cd "$repo" || error "Cannot setup test environment"
- git-init-db >&3 2>&4 ||
- error "cannot run git-init-db -- have you installed git-core?"
+ git-init >/dev/null 2>&1 ||
+ error "cannot run git-init -- have you installed git-core?"
mv .git/hooks .git/hooks-disabled
echo "empty start" |
git-commit-tree `git-write-tree` >.git/refs/heads/master 2>&4 ||
@@ -195,7 +261,8 @@ test_done () {
# t/ subdirectory and are run in trash subdirectory.
PATH=$(pwd)/..:$PATH
HOME=$(pwd)/trash
-export PATH HOME
+GIT_CONFIG=.git/config
+export PATH HOME GIT_CONFIG
# Test repository
@@ -203,3 +270,22 @@ test=trash
rm -fr "$test"
test_create_repo $test
cd "$test"
+
+this_test=$(expr "./$0" : '.*/\(t[0-9]*\)-[^/]*$')
+for skp in $GIT_SKIP_TESTS
+do
+ to_skip=
+ for skp in $GIT_SKIP_TESTS
+ do
+ case "$this_test" in
+ $skp)
+ to_skip=t
+ esac
+ done
+ case "$to_skip" in
+ t)
+ say >&3 "skipping test $this_test altogether"
+ say "skip all tests in $this_test"
+ test_done
+ esac
+done
^ permalink raw reply related
* Re: pull into dirty working tree
From: Linus Torvalds @ 2007-06-14 20:30 UTC (permalink / raw)
To: Olivier Galibert; +Cc: Bill Lear, git
In-Reply-To: <20070614202027.GA47039@dspnet.fr.eu.org>
On Thu, 14 Jun 2007, Olivier Galibert wrote:
> On Thu, Jun 14, 2007 at 08:46:27AM -0700, Linus Torvalds wrote:
> > So it might be easier to take a "git stash ; git pull ; git unstash"
> > approach instead of making "git pull" handle working tree conflicts
> > itseld.
>
> Isn't that "git add .; git commit; git fetch; git rebase <something>;
> git reset ^HEAD"? With the conflict resolution happening at rebase
> time.
No.
The two workflows happen to co-incide *if* the "git pull" is a
fast-forward, but not if you actually had previous commits that you
wanted the "git pull" to merge.
So if you want things to actually work as a "git pull with dirty state
merge", you really do need to do "git stash + git pull + git unstash".
Linus
^ permalink raw reply
* Re: pull into dirty working tree
From: Olivier Galibert @ 2007-06-14 20:20 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Bill Lear, git
In-Reply-To: <alpine.LFD.0.98.0706140836450.14121@woody.linux-foundation.org>
On Thu, Jun 14, 2007 at 08:46:27AM -0700, Linus Torvalds wrote:
> So it might be easier to take a "git stash ; git pull ; git unstash"
> approach instead of making "git pull" handle working tree conflicts
> itseld.
Isn't that "git add .; git commit; git fetch; git rebase <something>;
git reset ^HEAD"? With the conflict resolution happening at rebase
time.
OG.
^ permalink raw reply
* Re: [CORRECTED PATCH] Introduce file with the common default build-time items.
From: Eygene Ryabinkin @ 2007-06-14 19:07 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git
In-Reply-To: <20070614150929.GA18491@spearce.org>
Shawn,
Thu, Jun 14, 2007 at 11:09:29AM -0400, Shawn O. Pearce wrote:
> Eygene Ryabinkin <rea-git@codelabs.ru> wrote:
> No, because Junio has already stated a desire to remove git-gui.git
> from git.git and convert it to a proper subproject by the time of
> Git 1.6. That means the git-gui/ subdirectory will become optional,
> though I imagine most git-gui users will still have it. But not
> all Git users are git-gui users. ;-)
OK, it means that git-gui will be totally separated from the
git.git? And one will download it as the separate tarball?
> The best we can do is let the user pick their TCL_PATH and
> TCLTK_PATH up in git's own Makefile, and have it pass down into
> git-gui's Makefile when git-gui is being built from within git.
> That is the arrangement we currently have.
OK, fine, thanks for the explanations. The corrected patch follows.
-----
Words 'wish' and 'tclsh' are scattered across at least three files,
but they are tied to the same entities. To ease the maintenance
and remove errors, these configuration items were gathered into the
separate file named 'common-make-vars.def'.
Signed-off-by: Eygene Ryabinkin <rea-git@codelabs.ru>
---
Makefile | 17 +++++++++++------
common-make-vars.def | 11 +++++++++++
configure.ac | 4 +++-
3 files changed, 25 insertions(+), 7 deletions(-)
create mode 100644 common-make-vars.def
diff --git a/Makefile b/Makefile
index 6cd9ea2..e98f16b 100644
--- a/Makefile
+++ b/Makefile
@@ -116,16 +116,21 @@ all::
#
# The TCL_PATH variable governs the location of the Tcl interpreter
# used to optimize git-gui for your system. Only used if NO_TCLTK
-# is not set. Defaults to the bare 'tclsh'.
+# is not set. Defaults to the value of the __GIT_DEFAULT_TCLSH_NAME
+# from common-make-vars.def.
#
-# The TCLTK_PATH variable governs the location of the Tcl/Tk interpreter.
-# If not set it defaults to the bare 'wish'. If it is set to the empty
-# string then NO_TCLTK will be forced (this is used by configure script).
+# The TCLTK_PATH variable governs the location of the Tcl/Tk
+# interpreter. If not set it defaults to the value of the
+# __GIT_DEFAULT_TCLTK_NAME from common-make-vars.def. If it is set
+# to the empty string then NO_TCLTK will be forced (this is used
+# by configure script).
#
GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
@$(SHELL_PATH) ./GIT-VERSION-GEN
-include GIT-VERSION-FILE
+# Default values
+-include common-make-vars.def
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
@@ -177,8 +182,8 @@ AR ?= ar
TAR ?= tar
INSTALL ?= install
RPMBUILD ?= rpmbuild
-TCL_PATH ?= tclsh
-TCLTK_PATH ?= wish
+TCL_PATH ?= $(__GIT_DEFAULT_TCLSH_NAME)
+TCLTK_PATH ?= $(__GIT_DEFAULT_TCLTK_NAME)
export TCL_PATH TCLTK_PATH
diff --git a/common-make-vars.def b/common-make-vars.def
new file mode 100644
index 0000000..43a3a8b
--- /dev/null
+++ b/common-make-vars.def
@@ -0,0 +1,11 @@
+# This file is meant to be sourced from the autoconf script
+# and included from the Makefile. It carries the default values
+# to eliminate their redundancy across the files. The syntax
+# is 'name=value' without extra spaces across the '=' sign to
+# make shell happy. Symbols '#' are starting comments ;))
+
+# Default Tcl/Tk interpreter name
+__GIT_DEFAULT_TCLTK_NAME=wish
+
+# Default Tcl interpreter name
+__GIT_DEFAULT_TCLSH_NAME=tclsh
diff --git a/configure.ac b/configure.ac
index 50d2b85..fd1d241 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,6 +12,8 @@ config_in=config.mak.in
echo "# ${config_append}. Generated by configure." > "${config_append}"
+## Defaults
+source common-make-vars.def
## Definitions of macros
# GIT_CONF_APPEND_LINE(LINE)
@@ -97,7 +99,7 @@ AC_CHECK_PROGS(TAR, [gtar tar])
if test -z "$NO_TCLTK"; then
if test "$with_tcltk" = ""; then
# No Tcl/Tk switches given. Do not check for Tcl/Tk, use bare 'wish'.
- TCLTK_PATH=wish
+ TCLTK_PATH=${__GIT_DEFAULT_TCLTK_NAME}
AC_SUBST(TCLTK_PATH)
elif test "$with_tcltk" = "yes"; then
# Tcl/Tk check requested.
--
1.5.2.1
^ permalink raw reply related
* [PATCH] Add test-script for git-tag
From: Johannes Schindelin @ 2007-06-14 17:58 UTC (permalink / raw)
To: Carlos Rica; +Cc: git, gitster
In-Reply-To: <1b46aba20706140945i2545c06fxce3fda71fe59a7af@mail.gmail.com>
From: Carlos Rica <jasampler@gmail.com>
These tests are useful to develop the C version for git-tag.sh,
ensuring that the future builtin-tag.c will not break previous
behaviour.
The tests are focused on listing, verifying, deleting and creating
tags, checking always that the correct status value is returned
and everything remains as expected.
In order to verify and create signed tags, a PGP key was also
added, being created this way: gpg --homedir t/t7003 --gen-key
Type DSA and Elgamal, size 2048 bits, no expiration date.
Name and email: C O Mitter <committer@example.com>
No password given, to enable non-interactive operation.
Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
Gmail had a problem with one line. Thus the resend.
t/t7003-tag.sh | 616 +++++++++++++++++++++++++++++++++++++++++++++++++++
t/t7003/pubring.gpg | Bin 0 -> 1164 bytes
t/t7003/random_seed | Bin 0 -> 600 bytes
t/t7003/secring.gpg | Bin 0 -> 1237 bytes
t/t7003/trustdb.gpg | Bin 0 -> 1280 bytes
5 files changed, 616 insertions(+), 0 deletions(-)
create mode 100755 t/t7003-tag.sh
create mode 100644 t/t7003/pubring.gpg
create mode 100644 t/t7003/random_seed
create mode 100644 t/t7003/secring.gpg
create mode 100644 t/t7003/trustdb.gpg
diff --git a/t/t7003-tag.sh b/t/t7003-tag.sh
new file mode 100755
index 0000000..d998dd2
--- /dev/null
+++ b/t/t7003-tag.sh
@@ -0,0 +1,616 @@
+#!/bin/sh
+#
+# Copyright (c) 2007 Carlos Rica
+#
+
+test_description='git-tag
+
+Basic tests for operations with tags.'
+
+. ./test-lib.sh
+
+# creating and listing lightweight tags:
+
+tag_exists () {
+ git show-ref --quiet --verify refs/tags/$1
+}
+
+test_expect_success 'listing all tags in an empty tree now should succeed' \
+ 'git tag -l'
+
+test_expect_success 'listing all tags in an empty tree should output nothing' \
+ 'test `git-tag -l | wc -l` -eq 0'
+
+test_expect_failure 'looking for a tag in an empty tree should fail' \
+ 'tag_exists mytag'
+
+test_expect_failure 'creating a tag in an empty tree should fail' '
+ git-tag mynotag ||
+ tag_exists mynotag
+'
+
+test_expect_failure 'creating a tag for HEAD in an empty tree should fail' '
+ git-tag mytaghead HEAD ||
+ tag_exists mytaghead
+'
+
+test_expect_failure 'creating a tag for an unknown revision should fail' '
+ git-tag mytagnorev aaaaaaaaaaa ||
+ tag_exists mytagnorev
+'
+
+test_expect_success 'creating a tag using default HEAD should succeed' '
+ echo foo >foo &&
+ git add foo &&
+ test_tick && git commit -m Foo &&
+ git tag mytag
+'
+
+test_expect_success 'listing all tags if one exists now also should succeed' \
+ 'git-tag -l'
+
+test_expect_success 'listing all tags if one exists should output that tag' \
+ 'test `git-tag -l` = mytag'
+
+# pattern matching:
+
+test_expect_success 'listing a tag using a matching pattern should succeed' \
+ 'git-tag -l mytag'
+
+test_expect_success \
+ 'listing a tag using a matching pattern should output that tag' \
+ 'test `git-tag -l mytag` = mytag'
+
+test_expect_success \
+ 'listing tags using a non-matching pattern now should suceed' \
+ 'git-tag -l xxx'
+
+test_expect_success \
+ 'listing tags using a non-matching pattern should output nothing' \
+ 'test `git-tag -l xxx | wc -l` -eq 0'
+
+# special cases for creating tags:
+
+test_expect_failure \
+ 'trying to create a tag with the name of one existing should fail' \
+ 'git tag mytag'
+
+test_expect_failure 'trying to create a tag with a non-valid name should fail' '
+ test `git-tag -l | wc -l` -ne 1 ||
+ git tag .othertag ||
+ git tag "other tag" ||
+ git tag "othertag^" ||
+ git tag "other~tag" ||
+ test `git-tag -l | wc -l` -ne 1
+'
+
+test_expect_success 'creating a tag using HEAD directly should succeed' '
+ git tag myhead HEAD &&
+ tag_exists myhead
+'
+
+# deleting tags:
+
+test_expect_failure 'trying to delete an unknown tag should fail' '
+ tag_exists unknown-tag ||
+ git-tag -d unknown-tag
+'
+
+cat >expect <<EOF
+myhead
+mytag
+EOF
+test_expect_success \
+ 'trying to delete tags without params should succeed and do nothing' '
+ git tag -l > actual && git diff expect actual &&
+ git-tag -d &&
+ git tag -l > actual && git diff expect actual
+'
+
+test_expect_success \
+ 'deleting two existing tags in one command should succeed' '
+ tag_exists mytag &&
+ tag_exists myhead &&
+ git-tag -d mytag myhead &&
+ ! tag_exists mytag &&
+ ! tag_exists myhead
+'
+
+test_expect_success \
+ 'creating a tag with the name of another deleted one should succeed' '
+ ! tag_exists mytag &&
+ git-tag mytag &&
+ tag_exists mytag
+'
+
+test_expect_failure \
+ 'trying to delete two tags -existing and not- should fail for the 2nd' '
+ tag_exists mytag &&
+ ! tag_exists myhead &&
+ git-tag -d mytag anothertag
+ ! tag_exists mytag &&
+ ! tag_exists myhead &&
+'
+
+test_expect_failure 'trying to delete an already deleted tag should fail' \
+ 'git-tag -d mytag'
+
+# listing various tags with pattern matching:
+
+cat >expect <<EOF
+a1
+aa1
+cba
+t210
+t211
+v0.2.1
+v1.0
+v1.0.1
+v1.1.3
+EOF
+test_expect_success 'listing all tags should print them ordered' '
+ git tag v1.0.1 &&
+ git tag t211 &&
+ git tag aa1 &&
+ git tag v0.2.1 &&
+ git tag v1.1.3 &&
+ git tag cba &&
+ git tag a1 &&
+ git tag v1.0 &&
+ git tag t210 &&
+ git tag -l > actual
+ git diff expect actual
+'
+
+cat >expect <<EOF
+a1
+aa1
+cba
+EOF
+test_expect_success \
+ 'listing tags with substring as pattern now must print those matching' '
+ git-tag -l a > actual &&
+ git-diff expect actual
+'
+
+cat >expect <<EOF
+v0.2.1
+v1.0.1
+v1.1.3
+EOF
+test_expect_success \
+ 'listing tags with substring as pattern now must print those matching' '
+ git-tag -l .1 > actual &&
+ git-diff expect actual
+'
+
+cat >expect <<EOF
+t210
+t211
+EOF
+test_expect_success \
+ 'listing tags with substring as pattern now must print those matching' '
+ git-tag -l t21 > actual &&
+ git-diff expect actual
+'
+
+cat >expect <<EOF
+a1
+aa1
+EOF
+test_expect_success \
+ 'listing tags using a name as pattern now must print those matching' '
+ git-tag -l a1 > actual &&
+ git-diff expect actual
+'
+
+cat >expect <<EOF
+v1.0
+v1.0.1
+EOF
+test_expect_success \
+ 'listing tags using a name as pattern now must print those matching' '
+ git-tag -l v1.0 > actual &&
+ git-diff expect actual
+'
+
+cat >expect <<EOF
+v1.1.3
+EOF
+test_expect_success \
+ 'listing tags with ? in the pattern should print those matching' '
+ git-tag -l 1.1? > actual &&
+ git-diff expect actual
+'
+
+# creating and verifying lightweight tags:
+
+test_expect_success \
+ 'a non-annotated tag created without parameters should point to HEAD' '
+ git-tag non-annotated-tag &&
+ ! git cat-file tag non-annotated-tag &&
+ test "$(git rev-parse non-annotated-tag^{commit})" = \
+ "$(git rev-parse HEAD)"
+'
+
+test_expect_failure 'trying to verify an unknown tag should fail' \
+ 'git-tag -v unknown-tag'
+
+test_expect_failure \
+ 'trying to verify a non-annotated and non-signed tag should fail' \
+ 'git-tag -v non-annotated-tag'
+
+# creating annotated tags:
+
+get_tag_msg () {
+ git cat-file tag "$1" | sed -n -e "1,/BEGIN PGP/p"
+}
+
+get_tag_header () {
+cat >expect <<EOF
+object $2
+type commit
+tag $1
+tagger C O Mitter <committer@example.com> $3 -0700
+
+EOF
+}
+
+commit=$(git rev-parse HEAD)
+time=$test_tick
+
+get_tag_header annotated-tag $commit $time >expect
+echo "A message" >>expect
+test_expect_success \
+ 'creating an annotated tag with -m message should succeed' '
+ git-tag -m "A message" annotated-tag &&
+ get_tag_msg annotated-tag >actual &&
+ git diff expect actual
+'
+
+cat >msgfile <<EOF
+Another message
+in a file.
+EOF
+get_tag_header file-annotated-tag $commit $time >expect
+cat msgfile >>expect
+test_expect_success \
+ 'creating an annotated tag with -F messagefile should succeed' '
+ git-tag -F msgfile file-annotated-tag &&
+ get_tag_msg file-annotated-tag >actual &&
+ git diff expect actual
+'
+
+# blank and empty messages:
+
+get_tag_header empty-annotated-tag $commit $time >expect
+test_expect_success \
+ 'creating a tag with an empty -m message should succeed' '
+ git-tag -m "" empty-annotated-tag &&
+ get_tag_msg empty-annotated-tag >actual &&
+ git diff expect actual
+'
+
+touch emptyfile
+get_tag_header emptyfile-annotated-tag $commit $time >expect
+test_expect_success \
+ 'creating a tag with an empty -F messagefile should succeed' '
+ git-tag -F emptyfile emptyfile-annotated-tag &&
+ get_tag_msg emptyfile-annotated-tag >actual &&
+ git diff expect actual
+'
+
+printf '\n\n \n\t\nLeading blank lines\n' >blanksfile
+printf '\n\t \t \nRepeated blank lines\n' >>blanksfile
+printf '\n\n\nTrailing spaces \t \n' >>blanksfile
+printf '\nTrailing blank lines\n\n\t \n\n' >>blanksfile
+get_tag_header blanks-annotated-tag $commit $time >expect
+cat >>expect <<EOF
+Leading blank lines
+
+Repeated blank lines
+
+Trailing spaces
+
+Trailing blank lines
+EOF
+test_expect_success \
+ 'extra blanks in the message for an annotated tag should be removed' '
+ git-tag -F blanksfile blanks-annotated-tag &&
+ get_tag_msg blanks-annotated-tag >actual &&
+ git diff expect actual
+'
+
+get_tag_header blank-annotated-tag $commit $time >expect
+test_expect_success \
+ 'creating a tag with blank -m message with spaces should succeed' '
+ git-tag -m " " blank-annotated-tag &&
+ get_tag_msg blank-annotated-tag >actual &&
+ git diff expect actual
+'
+
+echo ' ' >blankfile
+echo '' >>blankfile
+echo ' ' >>blankfile
+get_tag_header blankfile-annotated-tag $commit $time >expect
+test_expect_success \
+ 'creating a tag with blank -F messagefile with spaces should succeed' '
+ git-tag -F blankfile blankfile-annotated-tag &&
+ get_tag_msg blankfile-annotated-tag >actual &&
+ git diff expect actual
+'
+
+printf ' ' >blanknonlfile
+get_tag_header blanknonlfile-annotated-tag $commit $time >expect
+test_expect_success \
+ 'creating a tag with -F file of spaces and no newline should succeed' '
+ git-tag -F blanknonlfile blanknonlfile-annotated-tag &&
+ get_tag_msg blanknonlfile-annotated-tag >actual &&
+ git diff expect actual
+'
+
+# messages with commented lines:
+
+cat >commentsfile <<EOF
+# A comment
+
+############
+The message.
+############
+One line.
+
+
+# commented lines
+# commented lines
+
+Another line.
+# comments
+
+Last line.
+EOF
+get_tag_header comments-annotated-tag $commit $time >expect
+cat >>expect <<EOF
+The message.
+One line.
+
+Another line.
+
+Last line.
+EOF
+test_expect_success \
+ 'creating a tag using a -F messagefile with #comments should succeed' '
+ git-tag -F commentsfile comments-annotated-tag &&
+ get_tag_msg comments-annotated-tag >actual &&
+ git diff expect actual
+'
+
+get_tag_header comment-annotated-tag $commit $time >expect
+test_expect_success \
+ 'creating a tag with a #comment in the -m message should succeed' '
+ git-tag -m "#comment" comment-annotated-tag &&
+ get_tag_msg comment-annotated-tag >actual &&
+ git diff expect actual
+'
+
+echo '#comment' >commentfile
+echo '' >>commentfile
+echo '####' >>commentfile
+get_tag_header commentfile-annotated-tag $commit $time >expect
+test_expect_success \
+ 'creating a tag with #comments in the -F messagefile should succeed' '
+ git-tag -F commentfile commentfile-annotated-tag &&
+ get_tag_msg commentfile-annotated-tag >actual &&
+ git diff expect actual
+'
+
+printf '#comment' >commentnonlfile
+get_tag_header commentnonlfile-annotated-tag $commit $time >expect
+test_expect_success \
+ 'creating a tag with a file of #comment and no newline should succeed' '
+ git-tag -F commentnonlfile commentnonlfile-annotated-tag &&
+ get_tag_msg commentnonlfile-annotated-tag >actual &&
+ git diff expect actual
+'
+
+# trying to verify annotated non-signed tags:
+
+test_expect_failure \
+ 'trying to verify an annotated non-signed tag should fail' '
+ ! tag_exists annotated-tag ||
+ git-tag -v annotated-tag
+'
+
+test_expect_failure \
+ 'trying to verify a file-annotated non-signed tag should fail' '
+ ! tag_exists file-annotated-tag ||
+ git-tag -v file-annotated-tag
+'
+
+# creating and verifying signed tags:
+
+gpg --version >/dev/null
+if [ $? -eq 127 ]; then
+ echo "Skipping signed tags tests, because gpg was not found"
+ test_done
+ exit
+fi
+
+# key generation info: gpg --homedir t/t7003 --gen-key
+# Type DSA and Elgamal, size 2048 bits, no expiration date.
+# Name and email: C O Mitter <committer@example.com>
+# No password given, to enable non-interactive operation.
+
+cp -R ../t7003 ./gpghome
+chmod 0700 gpghome
+export GNUPGHOME="$(pwd)/gpghome"
+
+get_tag_header signed-tag $commit $time >expect
+echo 'A signed tag message' >>expect
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success 'creating a signed tag with -m message should succeed' '
+ git-tag -s -m "A signed tag message" signed-tag &&
+ get_tag_msg signed-tag >actual &&
+ git-diff expect actual
+'
+
+test_expect_success 'verifying a signed tag should succeed' \
+ 'git-tag -v signed-tag'
+
+# blank and empty messages for signed tags:
+
+get_tag_header empty-signed-tag $commit $time >expect
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success \
+ 'creating a signed tag with an empty -m message should succeed' '
+ git-tag -s -m "" empty-signed-tag &&
+ get_tag_msg empty-signed-tag >actual &&
+ git diff expect actual &&
+ git-tag -v empty-signed-tag
+'
+
+touch sigemptyfile
+get_tag_header emptyfile-signed-tag $commit $time >expect
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success \
+ 'creating a signed tag with an empty -F messagefile should succeed' '
+ git-tag -s -F sigemptyfile emptyfile-signed-tag &&
+ get_tag_msg emptyfile-signed-tag >actual &&
+ git diff expect actual &&
+ git-tag -v emptyfile-signed-tag
+'
+
+printf '\n\n \n\t\nLeading blank lines\n' > sigblanksfile
+printf '\n\t \t \nRepeated blank lines\n' >>sigblanksfile
+printf '\n\n\nTrailing spaces \t \n' >>sigblanksfile
+printf '\nTrailing blank lines\n\n\t \n\n' >>sigblanksfile
+get_tag_header blanks-signed-tag $commit $time >expect
+cat >>expect <<EOF
+Leading blank lines
+
+Repeated blank lines
+
+Trailing spaces
+
+Trailing blank lines
+EOF
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success \
+ 'extra blanks in the message for a signed tag should be removed' '
+ git-tag -s -F sigblanksfile blanks-signed-tag &&
+ get_tag_msg blanks-signed-tag >actual &&
+ git diff expect actual &&
+ git-tag -v blanks-signed-tag
+'
+
+get_tag_header blank-signed-tag $commit $time >expect
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success \
+ 'creating a signed tag with a blank -m message should succeed' '
+ git-tag -s -m " " blank-signed-tag &&
+ get_tag_msg blank-signed-tag >actual &&
+ git diff expect actual &&
+ git-tag -v blank-signed-tag
+'
+
+echo ' ' >sigblankfile
+echo '' >>sigblankfile
+echo ' ' >>sigblankfile
+get_tag_header blankfile-signed-tag $commit $time >expect
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success \
+ 'creating a signed tag with blank -F file with spaces should succeed' '
+ git-tag -s -F sigblankfile blankfile-signed-tag &&
+ get_tag_msg blankfile-signed-tag >actual &&
+ git diff expect actual &&
+ git-tag -v blankfile-signed-tag
+'
+
+printf ' ' >sigblanknonlfile
+get_tag_header blanknonlfile-signed-tag $commit $time >expect
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success \
+ 'creating a signed tag with spaces and no newline should succeed' '
+ git-tag -s -F sigblanknonlfile blanknonlfile-signed-tag &&
+ get_tag_msg blanknonlfile-signed-tag >actual &&
+ git diff expect actual &&
+ git-tag -v signed-tag
+'
+
+# messages with commented lines for signed tags:
+
+cat >sigcommentsfile <<EOF
+# A comment
+
+############
+The message.
+############
+One line.
+
+
+# commented lines
+# commented lines
+
+Another line.
+# comments
+
+Last line.
+EOF
+get_tag_header comments-signed-tag $commit $time >expect
+cat >>expect <<EOF
+The message.
+One line.
+
+Another line.
+
+Last line.
+EOF
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success \
+ 'creating a signed tag with a -F file with #comments should succeed' '
+ git-tag -s -F sigcommentsfile comments-signed-tag &&
+ get_tag_msg comments-signed-tag >actual &&
+ git diff expect actual &&
+ git-tag -v comments-signed-tag
+'
+
+get_tag_header comment-signed-tag $commit $time >expect
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success \
+ 'creating a signed tag with #commented -m message should succeed' '
+ git-tag -s -m "#comment" comment-signed-tag &&
+ get_tag_msg comment-signed-tag >actual &&
+ git diff expect actual &&
+ git-tag -v comment-signed-tag
+'
+
+echo '#comment' >sigcommentfile
+echo '' >>sigcommentfile
+echo '####' >>sigcommentfile
+get_tag_header commentfile-signed-tag $commit $time >expect
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success \
+ 'creating a signed tag with #commented -F messagefile should succeed' '
+ git-tag -s -F sigcommentfile commentfile-signed-tag &&
+ get_tag_msg commentfile-signed-tag >actual &&
+ git diff expect actual &&
+ git-tag -v commentfile-signed-tag
+'
+
+printf '#comment' >sigcommentnonlfile
+get_tag_header commentnonlfile-signed-tag $commit $time >expect
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success \
+ 'creating a signed tag with a #comment and no newline should succeed' '
+ git-tag -s -F sigcommentnonlfile commentnonlfile-signed-tag &&
+ get_tag_msg commentnonlfile-signed-tag >actual &&
+ git diff expect actual &&
+ git-tag -v commentnonlfile-signed-tag
+'
+
+rm -rf gpghome
+test_expect_failure \
+ 'verify signed tag fails when public key is not present' \
+ 'git-tag -v signed-tag'
+
+test_done
+
diff --git a/t/t7003/pubring.gpg b/t/t7003/pubring.gpg
new file mode 100644
index 0000000000000000000000000000000000000000..83855fa4e1c6c37afe550c17afa1e7971042ded5
GIT binary patch
literal 1164
zcmV;71ateD0ipy(XUi!O1OT%L_{gO;4KKDfwF;#WWYZ2?*>Ph_j9y>uobJf#jXEbw
zQUOEXs+@;X*)1kyN*7VwW}f-GD3>Vlu2F6j{T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jyeue<@oS$3l
zEu9m5O={<O&85HqUN|R$bZiPXX4YsWsPOn@@M)Lf;hyI_(eM$*#Sf3}T=1jzGvsiy
ziKuCmV^)`UC@8ma=jBiHqr!1L4>w`5P=-vvIiJTGj0-lRpc+EU9(`B#rn1m1WqmXr
z5Z+N|DR*y*k<4fY0I_eP7qVo9Fx58WMwaK^N~I=>1VN29R|Umg^2q$WGlE#9AFC2_
zOYG5M$}OL?FQ)ej0!KGwY-hAFz#wAPr>3&{`s7!HUZ22Y7KY{9ly1wQ8^hqBojPv8
zh)Dz(5dr`S1p-EA%T59t3;+rV5EHib9?jlE4Z-XHpqd%~B34SUmtRi+{;vv2ei?p%
eLjau^#pu5ba=n|GS94<zkje^zT1YFf0ssTLm?$>@
literal 0
HcmV?d00001
diff --git a/t/t7003/random_seed b/t/t7003/random_seed
new file mode 100644
index 0000000000000000000000000000000000000000..8fed1339ed0a744e5663f4a5e6b6ac9bae3d8524
GIT binary patch
literal 600
zcmV-e0;m1=h9nBV>1C6QsKJEiEJaD@Q3F8s5u<$E+<2(By)JAZSxviTsXg(wKC+O%
zzvV{Z>W3*k?r7~pgmmkbw8-x{Am!eeN)z?cwIHcT2jqgiA(SXo<iO=E?cY80`p#w8
z)O-&?SnwsJ=1VJ-?26&*g88Nr8E=g2onRW^(c+2nJlX)?dmK)tPO0EY-!B!vMCv1)
z-AOW(3WuF+7IdSxMnzrDgnMqVU=|+YFxlY|VeR+Fg<%C@0Xupi0<S7QYJyFTR$}FQ
zzoSAbU>CoCKWKX;!3@L_U=aFUm!M<>ILG}$`bfnadAkLQbI-upV7Qwf^OE&N45Pz<
zk~^KlzNC6)d@QGv=K5-At&A8FS&MQSR`LB}@R1?A3K1p(vM>7CK}EfFhmBJd&cH^-
z(3Ih^`VuoVBB|w~p!Q^#DY%V2A2FhXu<Bp*L)lSCUdqRyI5wxMG&E1sL$)E$Zo&pJ
zgy#;fENqHImgN>LL2!7DhfZ}&;BSAyz=T0#S?2+NET5St@16L?YI?5Io%<uD|2}hl
zx0xsuefz1+bM^-ZIgtKs=)&VAI8(MfytvM>t>%~nsXUb~*EkptHiN?W{=DRu_s;2u
ziHh{2&>;CQO7;>{$DN33_Ef}g+;b<2hIF^p(Y>^riLBb*Y2Xw>F8)jp49&oLKJOic
z+V{Lt!_`eKGhyk5Edie{-^#n!TFlsfux*QBRZEh^4SVePPmb{BvF|>sKd2cYg@vKp
mVI8jcB1(k(tlt^Kr<{EMs>|b*d70nyVMQcc%xEnE(#Uq3d^-35
literal 0
HcmV?d00001
diff --git a/t/t7003/secring.gpg b/t/t7003/secring.gpg
new file mode 100644
index 0000000000000000000000000000000000000000..d831cd9eb3eee613d3c0e1a71093ae01ea7347e3
GIT binary patch
literal 1237
zcmV;`1S<QL0lNf7XUi!O1OT%L_{gO;4KKDfwF;#WWYZ2?*>Ph_j9y>uobJf#jXEbw
zQUOEXs+@;X*)1kyN*7VwW}f-GD3>Vlu2F6j{T^Kt%(kMo(W3C}W^X)NL|0VdGIzc`
z5@TY!;Du~AFGW=#0vYgS@U2j8Q{Qe9F~lQEBVt+(yjM1jQ{YLe0lxsC<HX~BiFSU3
zs3oq~QtxsAzbwuV1N{{&PcudMk6}p><?O}^6vikhMm+>LD}W25r?wdKr$(|R8_;Mn
z&Yh%2Hbu9IX>#(R8S&@jVI!K^K7AI$=A+*-qJ>-J^fdR_m5GZao*%P{nee=O$Eb$s
zes#O%4Z_4OAZW}8Ey8%%w->rA>z!nf)&NPikkr&pkRlB>=W+x68fwevWl9Ys2R3m2
zNPf<ig>x1y^AXyemu>Q}DAp%==Q`5sCrBzLaH^rOm1NLtt-ig*IfY?HMdv66@%u%#
zy0K62;Z+4O3Ol6i*<7GlXeW6FC?0yV!c_#yGozNjrOE#8+Rw@Z8cGAG=eE%uMUW=V
zX(76db;AG@lD)hA005tK#LT31ryNoF9o-(`X`Xl5w88@mle8j3AWtAoX>@dDav(fo
zZ*6U9baZ8MKxKGgZE$R5E@N+PK8Rif6A=Oc9t8qMXUi!98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000000000000..abace962b8bf84be688a6f27e4ebd0ee7052f210
GIT binary patch
literal 1280
zcmZQfFGy!*W@Ke#U|?`dKkWykumMIcY@%4iM%7^n6rj+M4;MLzzlOX&pwTnxkD-}P
zc^HbXN0fL!SIq1?>env3?W^3`d(OOU5YNaX{KU(k^<0;M@87ONv)_6ZxD={-=<kYO
M2Ud3=2BC}r0AuhNr2qf`
literal 0
HcmV?d00001
--
1.5.2.1.2876.g6670-dirty
^ permalink raw reply related
* Re: [PATCH guilt] make guilt use standard POSIX shell
From: Pierre Habouzit @ 2007-06-14 17:16 UTC (permalink / raw)
To: Josef Sipek; +Cc: git
In-Reply-To: <20070614163940.GA4752@filer.fsl.cs.sunysb.edu>
[-- Attachment #1: Type: text/plain, Size: 1184 bytes --]
On Thu, Jun 14, 2007 at 12:39:40PM -0400, Josef Sipek wrote:
> On Thu, Jun 14, 2007 at 05:58:26PM +0200, Pierre Habouzit wrote:
> > On Thu, Jun 14, 2007 at 05:56:00PM +0200, Pierre Habouzit wrote:
> > > On Thu, Jun 14, 2007 at 11:27:02AM -0400, Josef Sipek wrote:
> > > > Thanks a lot!
> > >
> > > Well, worry for the obvious mistakes.
> > *sorry
> >
> > Now, *that* was an interesting typo :P
>
> :)
>
> Ok, pushed to kernel.org. I folded the 2 regression fixing patches into the
> right places.
Just a small remark: 87739d0e should be merged in the master branch,
as the regression suite does not work atm if you are using a shell that
does not understands enough bashisms.
The patch is safe (it only adds /bin/bash shebangs to tests, and
changes the way tests are called in the Makefile).
For the rest, I agree the patches should continue to live in a
separate branch until better coverage of the testsuite can give us more
faith in those patches :)
--
·O· Pierre Habouzit
··O madcoder@debian.org
OOO http://www.madism.org
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* [PATCH] Add test-script for git-tag
From: Carlos Rica @ 2007-06-14 16:45 UTC (permalink / raw)
To: git
These tests are useful to develop the C version for git-tag.sh,
ensuring that the future builtin-tag.c will not break previous
behaviour.
The tests are focused on listing, verifying, deleting and creating
tags, checking always that the correct status value is returned
and everything remains as expected.
In order to verify and create signed tags, a PGP key was also
added, being created this way: gpg --homedir t/t7003 --gen-key
Type DSA and Elgamal, size 2048 bits, no expiration date.
Name and email: C O Mitter <committer@example.com>
No password given, to enable non-interactive operation.
Signed-off-by: Carlos Rica <jasampler@gmail.com>
diff --git a/t/t7003-tag.sh b/t/t7003-tag.sh
new file mode 100755
index 0000000..d998dd2
--- /dev/null
+++ b/t/t7003-tag.sh
@@ -0,0 +1,616 @@
+#!/bin/sh
+#
+# Copyright (c) 2007 Carlos Rica
+#
+
+test_description='git-tag
+
+Basic tests for operations with tags.'
+
+. ./test-lib.sh
+
+# creating and listing lightweight tags:
+
+tag_exists () {
+ git show-ref --quiet --verify refs/tags/$1
+}
+
+test_expect_success 'listing all tags in an empty tree now should succeed' \
+ 'git tag -l'
+
+test_expect_success 'listing all tags in an empty tree should output nothing' \
+ 'test `git-tag -l | wc -l` -eq 0'
+
+test_expect_failure 'looking for a tag in an empty tree should fail' \
+ 'tag_exists mytag'
+
+test_expect_failure 'creating a tag in an empty tree should fail' '
+ git-tag mynotag ||
+ tag_exists mynotag
+'
+
+test_expect_failure 'creating a tag for HEAD in an empty tree should fail' '
+ git-tag mytaghead HEAD ||
+ tag_exists mytaghead
+'
+
+test_expect_failure 'creating a tag for an unknown revision should fail' '
+ git-tag mytagnorev aaaaaaaaaaa ||
+ tag_exists mytagnorev
+'
+
+test_expect_success 'creating a tag using default HEAD should succeed' '
+ echo foo >foo &&
+ git add foo &&
+ test_tick && git commit -m Foo &&
+ git tag mytag
+'
+
+test_expect_success 'listing all tags if one exists now also should succeed' \
+ 'git-tag -l'
+
+test_expect_success 'listing all tags if one exists should output that tag' \
+ 'test `git-tag -l` = mytag'
+
+# pattern matching:
+
+test_expect_success 'listing a tag using a matching pattern should succeed' \
+ 'git-tag -l mytag'
+
+test_expect_success \
+ 'listing a tag using a matching pattern should output that tag' \
+ 'test `git-tag -l mytag` = mytag'
+
+test_expect_success \
+ 'listing tags using a non-matching pattern now should suceed' \
+ 'git-tag -l xxx'
+
+test_expect_success \
+ 'listing tags using a non-matching pattern should output nothing' \
+ 'test `git-tag -l xxx | wc -l` -eq 0'
+
+# special cases for creating tags:
+
+test_expect_failure \
+ 'trying to create a tag with the name of one existing should fail' \
+ 'git tag mytag'
+
+test_expect_failure 'trying to create a tag with a non-valid name
should fail' '
+ test `git-tag -l | wc -l` -ne 1 ||
+ git tag .othertag ||
+ git tag "other tag" ||
+ git tag "othertag^" ||
+ git tag "other~tag" ||
+ test `git-tag -l | wc -l` -ne 1
+'
+
+test_expect_success 'creating a tag using HEAD directly should succeed' '
+ git tag myhead HEAD &&
+ tag_exists myhead
+'
+
+# deleting tags:
+
+test_expect_failure 'trying to delete an unknown tag should fail' '
+ tag_exists unknown-tag ||
+ git-tag -d unknown-tag
+'
+
+cat >expect <<EOF
+myhead
+mytag
+EOF
+test_expect_success \
+ 'trying to delete tags without params should succeed and do nothing' '
+ git tag -l > actual && git diff expect actual &&
+ git-tag -d &&
+ git tag -l > actual && git diff expect actual
+'
+
+test_expect_success \
+ 'deleting two existing tags in one command should succeed' '
+ tag_exists mytag &&
+ tag_exists myhead &&
+ git-tag -d mytag myhead &&
+ ! tag_exists mytag &&
+ ! tag_exists myhead
+'
+
+test_expect_success \
+ 'creating a tag with the name of another deleted one should succeed' '
+ ! tag_exists mytag &&
+ git-tag mytag &&
+ tag_exists mytag
+'
+
+test_expect_failure \
+ 'trying to delete two tags -existing and not- should fail for the 2nd' '
+ tag_exists mytag &&
+ ! tag_exists myhead &&
+ git-tag -d mytag anothertag
+ ! tag_exists mytag &&
+ ! tag_exists myhead &&
+'
+
+test_expect_failure 'trying to delete an already deleted tag should fail' \
+ 'git-tag -d mytag'
+
+# listing various tags with pattern matching:
+
+cat >expect <<EOF
+a1
+aa1
+cba
+t210
+t211
+v0.2.1
+v1.0
+v1.0.1
+v1.1.3
+EOF
+test_expect_success 'listing all tags should print them ordered' '
+ git tag v1.0.1 &&
+ git tag t211 &&
+ git tag aa1 &&
+ git tag v0.2.1 &&
+ git tag v1.1.3 &&
+ git tag cba &&
+ git tag a1 &&
+ git tag v1.0 &&
+ git tag t210 &&
+ git tag -l > actual
+ git diff expect actual
+'
+
+cat >expect <<EOF
+a1
+aa1
+cba
+EOF
+test_expect_success \
+ 'listing tags with substring as pattern now must print those matching' '
+ git-tag -l a > actual &&
+ git-diff expect actual
+'
+
+cat >expect <<EOF
+v0.2.1
+v1.0.1
+v1.1.3
+EOF
+test_expect_success \
+ 'listing tags with substring as pattern now must print those matching' '
+ git-tag -l .1 > actual &&
+ git-diff expect actual
+'
+
+cat >expect <<EOF
+t210
+t211
+EOF
+test_expect_success \
+ 'listing tags with substring as pattern now must print those matching' '
+ git-tag -l t21 > actual &&
+ git-diff expect actual
+'
+
+cat >expect <<EOF
+a1
+aa1
+EOF
+test_expect_success \
+ 'listing tags using a name as pattern now must print those matching' '
+ git-tag -l a1 > actual &&
+ git-diff expect actual
+'
+
+cat >expect <<EOF
+v1.0
+v1.0.1
+EOF
+test_expect_success \
+ 'listing tags using a name as pattern now must print those matching' '
+ git-tag -l v1.0 > actual &&
+ git-diff expect actual
+'
+
+cat >expect <<EOF
+v1.1.3
+EOF
+test_expect_success \
+ 'listing tags with ? in the pattern should print those matching' '
+ git-tag -l 1.1? > actual &&
+ git-diff expect actual
+'
+
+# creating and verifying lightweight tags:
+
+test_expect_success \
+ 'a non-annotated tag created without parameters should point to HEAD' '
+ git-tag non-annotated-tag &&
+ ! git cat-file tag non-annotated-tag &&
+ test "$(git rev-parse non-annotated-tag^{commit})" = \
+ "$(git rev-parse HEAD)"
+'
+
+test_expect_failure 'trying to verify an unknown tag should fail' \
+ 'git-tag -v unknown-tag'
+
+test_expect_failure \
+ 'trying to verify a non-annotated and non-signed tag should fail' \
+ 'git-tag -v non-annotated-tag'
+
+# creating annotated tags:
+
+get_tag_msg () {
+ git cat-file tag "$1" | sed -n -e "1,/BEGIN PGP/p"
+}
+
+get_tag_header () {
+cat >expect <<EOF
+object $2
+type commit
+tag $1
+tagger C O Mitter <committer@example.com> $3 -0700
+
+EOF
+}
+
+commit=$(git rev-parse HEAD)
+time=$test_tick
+
+get_tag_header annotated-tag $commit $time >expect
+echo "A message" >>expect
+test_expect_success \
+ 'creating an annotated tag with -m message should succeed' '
+ git-tag -m "A message" annotated-tag &&
+ get_tag_msg annotated-tag >actual &&
+ git diff expect actual
+'
+
+cat >msgfile <<EOF
+Another message
+in a file.
+EOF
+get_tag_header file-annotated-tag $commit $time >expect
+cat msgfile >>expect
+test_expect_success \
+ 'creating an annotated tag with -F messagefile should succeed' '
+ git-tag -F msgfile file-annotated-tag &&
+ get_tag_msg file-annotated-tag >actual &&
+ git diff expect actual
+'
+
+# blank and empty messages:
+
+get_tag_header empty-annotated-tag $commit $time >expect
+test_expect_success \
+ 'creating a tag with an empty -m message should succeed' '
+ git-tag -m "" empty-annotated-tag &&
+ get_tag_msg empty-annotated-tag >actual &&
+ git diff expect actual
+'
+
+touch emptyfile
+get_tag_header emptyfile-annotated-tag $commit $time >expect
+test_expect_success \
+ 'creating a tag with an empty -F messagefile should succeed' '
+ git-tag -F emptyfile emptyfile-annotated-tag &&
+ get_tag_msg emptyfile-annotated-tag >actual &&
+ git diff expect actual
+'
+
+printf '\n\n \n\t\nLeading blank lines\n' >blanksfile
+printf '\n\t \t \nRepeated blank lines\n' >>blanksfile
+printf '\n\n\nTrailing spaces \t \n' >>blanksfile
+printf '\nTrailing blank lines\n\n\t \n\n' >>blanksfile
+get_tag_header blanks-annotated-tag $commit $time >expect
+cat >>expect <<EOF
+Leading blank lines
+
+Repeated blank lines
+
+Trailing spaces
+
+Trailing blank lines
+EOF
+test_expect_success \
+ 'extra blanks in the message for an annotated tag should be removed' '
+ git-tag -F blanksfile blanks-annotated-tag &&
+ get_tag_msg blanks-annotated-tag >actual &&
+ git diff expect actual
+'
+
+get_tag_header blank-annotated-tag $commit $time >expect
+test_expect_success \
+ 'creating a tag with blank -m message with spaces should succeed' '
+ git-tag -m " " blank-annotated-tag &&
+ get_tag_msg blank-annotated-tag >actual &&
+ git diff expect actual
+'
+
+echo ' ' >blankfile
+echo '' >>blankfile
+echo ' ' >>blankfile
+get_tag_header blankfile-annotated-tag $commit $time >expect
+test_expect_success \
+ 'creating a tag with blank -F messagefile with spaces should succeed' '
+ git-tag -F blankfile blankfile-annotated-tag &&
+ get_tag_msg blankfile-annotated-tag >actual &&
+ git diff expect actual
+'
+
+printf ' ' >blanknonlfile
+get_tag_header blanknonlfile-annotated-tag $commit $time >expect
+test_expect_success \
+ 'creating a tag with -F file of spaces and no newline should succeed' '
+ git-tag -F blanknonlfile blanknonlfile-annotated-tag &&
+ get_tag_msg blanknonlfile-annotated-tag >actual &&
+ git diff expect actual
+'
+
+# messages with commented lines:
+
+cat >commentsfile <<EOF
+# A comment
+
+############
+The message.
+############
+One line.
+
+
+# commented lines
+# commented lines
+
+Another line.
+# comments
+
+Last line.
+EOF
+get_tag_header comments-annotated-tag $commit $time >expect
+cat >>expect <<EOF
+The message.
+One line.
+
+Another line.
+
+Last line.
+EOF
+test_expect_success \
+ 'creating a tag using a -F messagefile with #comments should succeed' '
+ git-tag -F commentsfile comments-annotated-tag &&
+ get_tag_msg comments-annotated-tag >actual &&
+ git diff expect actual
+'
+
+get_tag_header comment-annotated-tag $commit $time >expect
+test_expect_success \
+ 'creating a tag with a #comment in the -m message should succeed' '
+ git-tag -m "#comment" comment-annotated-tag &&
+ get_tag_msg comment-annotated-tag >actual &&
+ git diff expect actual
+'
+
+echo '#comment' >commentfile
+echo '' >>commentfile
+echo '####' >>commentfile
+get_tag_header commentfile-annotated-tag $commit $time >expect
+test_expect_success \
+ 'creating a tag with #comments in the -F messagefile should succeed' '
+ git-tag -F commentfile commentfile-annotated-tag &&
+ get_tag_msg commentfile-annotated-tag >actual &&
+ git diff expect actual
+'
+
+printf '#comment' >commentnonlfile
+get_tag_header commentnonlfile-annotated-tag $commit $time >expect
+test_expect_success \
+ 'creating a tag with a file of #comment and no newline should succeed' '
+ git-tag -F commentnonlfile commentnonlfile-annotated-tag &&
+ get_tag_msg commentnonlfile-annotated-tag >actual &&
+ git diff expect actual
+'
+
+# trying to verify annotated non-signed tags:
+
+test_expect_failure \
+ 'trying to verify an annotated non-signed tag should fail' '
+ ! tag_exists annotated-tag ||
+ git-tag -v annotated-tag
+'
+
+test_expect_failure \
+ 'trying to verify a file-annotated non-signed tag should fail' '
+ ! tag_exists file-annotated-tag ||
+ git-tag -v file-annotated-tag
+'
+
+# creating and verifying signed tags:
+
+gpg --version >/dev/null
+if [ $? -eq 127 ]; then
+ echo "Skipping signed tags tests, because gpg was not found"
+ test_done
+ exit
+fi
+
+# key generation info: gpg --homedir t/t7003 --gen-key
+# Type DSA and Elgamal, size 2048 bits, no expiration date.
+# Name and email: C O Mitter <committer@example.com>
+# No password given, to enable non-interactive operation.
+
+cp -R ../t7003 ./gpghome
+chmod 0700 gpghome
+export GNUPGHOME="$(pwd)/gpghome"
+
+get_tag_header signed-tag $commit $time >expect
+echo 'A signed tag message' >>expect
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success 'creating a signed tag with -m message should succeed' '
+ git-tag -s -m "A signed tag message" signed-tag &&
+ get_tag_msg signed-tag >actual &&
+ git-diff expect actual
+'
+
+test_expect_success 'verifying a signed tag should succeed' \
+ 'git-tag -v signed-tag'
+
+# blank and empty messages for signed tags:
+
+get_tag_header empty-signed-tag $commit $time >expect
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success \
+ 'creating a signed tag with an empty -m message should succeed' '
+ git-tag -s -m "" empty-signed-tag &&
+ get_tag_msg empty-signed-tag >actual &&
+ git diff expect actual &&
+ git-tag -v empty-signed-tag
+'
+
+touch sigemptyfile
+get_tag_header emptyfile-signed-tag $commit $time >expect
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success \
+ 'creating a signed tag with an empty -F messagefile should succeed' '
+ git-tag -s -F sigemptyfile emptyfile-signed-tag &&
+ get_tag_msg emptyfile-signed-tag >actual &&
+ git diff expect actual &&
+ git-tag -v emptyfile-signed-tag
+'
+
+printf '\n\n \n\t\nLeading blank lines\n' > sigblanksfile
+printf '\n\t \t \nRepeated blank lines\n' >>sigblanksfile
+printf '\n\n\nTrailing spaces \t \n' >>sigblanksfile
+printf '\nTrailing blank lines\n\n\t \n\n' >>sigblanksfile
+get_tag_header blanks-signed-tag $commit $time >expect
+cat >>expect <<EOF
+Leading blank lines
+
+Repeated blank lines
+
+Trailing spaces
+
+Trailing blank lines
+EOF
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success \
+ 'extra blanks in the message for a signed tag should be removed' '
+ git-tag -s -F sigblanksfile blanks-signed-tag &&
+ get_tag_msg blanks-signed-tag >actual &&
+ git diff expect actual &&
+ git-tag -v blanks-signed-tag
+'
+
+get_tag_header blank-signed-tag $commit $time >expect
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success \
+ 'creating a signed tag with a blank -m message should succeed' '
+ git-tag -s -m " " blank-signed-tag &&
+ get_tag_msg blank-signed-tag >actual &&
+ git diff expect actual &&
+ git-tag -v blank-signed-tag
+'
+
+echo ' ' >sigblankfile
+echo '' >>sigblankfile
+echo ' ' >>sigblankfile
+get_tag_header blankfile-signed-tag $commit $time >expect
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success \
+ 'creating a signed tag with blank -F file with spaces should succeed' '
+ git-tag -s -F sigblankfile blankfile-signed-tag &&
+ get_tag_msg blankfile-signed-tag >actual &&
+ git diff expect actual &&
+ git-tag -v blankfile-signed-tag
+'
+
+printf ' ' >sigblanknonlfile
+get_tag_header blanknonlfile-signed-tag $commit $time >expect
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success \
+ 'creating a signed tag with spaces and no newline should succeed' '
+ git-tag -s -F sigblanknonlfile blanknonlfile-signed-tag &&
+ get_tag_msg blanknonlfile-signed-tag >actual &&
+ git diff expect actual &&
+ git-tag -v signed-tag
+'
+
+# messages with commented lines for signed tags:
+
+cat >sigcommentsfile <<EOF
+# A comment
+
+############
+The message.
+############
+One line.
+
+
+# commented lines
+# commented lines
+
+Another line.
+# comments
+
+Last line.
+EOF
+get_tag_header comments-signed-tag $commit $time >expect
+cat >>expect <<EOF
+The message.
+One line.
+
+Another line.
+
+Last line.
+EOF
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success \
+ 'creating a signed tag with a -F file with #comments should succeed' '
+ git-tag -s -F sigcommentsfile comments-signed-tag &&
+ get_tag_msg comments-signed-tag >actual &&
+ git diff expect actual &&
+ git-tag -v comments-signed-tag
+'
+
+get_tag_header comment-signed-tag $commit $time >expect
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success \
+ 'creating a signed tag with #commented -m message should succeed' '
+ git-tag -s -m "#comment" comment-signed-tag &&
+ get_tag_msg comment-signed-tag >actual &&
+ git diff expect actual &&
+ git-tag -v comment-signed-tag
+'
+
+echo '#comment' >sigcommentfile
+echo '' >>sigcommentfile
+echo '####' >>sigcommentfile
+get_tag_header commentfile-signed-tag $commit $time >expect
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success \
+ 'creating a signed tag with #commented -F messagefile should succeed' '
+ git-tag -s -F sigcommentfile commentfile-signed-tag &&
+ get_tag_msg commentfile-signed-tag >actual &&
+ git diff expect actual &&
+ git-tag -v commentfile-signed-tag
+'
+
+printf '#comment' >sigcommentnonlfile
+get_tag_header commentnonlfile-signed-tag $commit $time >expect
+echo '-----BEGIN PGP SIGNATURE-----' >>expect
+test_expect_success \
+ 'creating a signed tag with a #comment and no newline should succeed' '
+ git-tag -s -F sigcommentnonlfile commentnonlfile-signed-tag &&
+ get_tag_msg commentnonlfile-signed-tag >actual &&
+ git diff expect actual &&
+ git-tag -v commentnonlfile-signed-tag
+'
+
+rm -rf gpghome
+test_expect_failure \
+ 'verify signed tag fails when public key is not present' \
+ 'git-tag -v signed-tag'
+
+test_done
+
diff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)t#yo}GERUSnBN
zlK-+<I<**0!u}jvbPz5b{hhe8_PVcR!i8ObFp-W0bqNWKA+W14zV9Mj$a~(KZ-0uf
z|BVvaf!K}k92MNalP4hQ^Yxqk-*SzY6q{6Cw*+Fr_+LZp=BFzuo3pVX*T?Ic-|hbZ
z1PurPv|=$EKX~Bz_Bz;JW71^>8;AnsY?5ub{hajO)@PHTt`On@Z;}jyeue<@oS$3l
zEu9m5O={<O&85HqUN|R$bZiPXX4YsWsPOn@@M)Lf;hyI_(eM$*#Sf3}T=1jzGvsiy
ziKuCmV^)`UC@8ma=jBiHqr!1L4>w`5P=-vvIiJTGj0-lRpc+EU9(`B#rn1m1WqmXr
z5Z+N|DR*y*k<4fY0I_eP7qVo9Fx58WMwaK^N~I=>1VN29R|Umg^2q$WGlE#9AFC2_
zOYG5M$}OL?FQ)ej0!KGwY-hAFz#wAPr>3&{`s7!HUZ22Y7KY{9ly1wQ8^hqBojPv8
zh)Dz(5dr`S1p-EA%T59t3;+rV5EHib9?jlE4Z-XHpqd%~B34SUmtRi+{;vv2ei?p%
eLjau^#pu5ba=n|GS94<zkje^zT1YFf0ssTLm?$>@
literal 0
Hc$@<O00001
diff --git a/t/t7003/random_seed b/t/t7003/random_seed
new file mode 100644
index 0000000000000000000000000000000000000000..8fed1339ed0a744e5663f4a5e6b6ac9bae3d8524
GIT binary patch
literal 600
zc$@)P0;m1=h9nBV>1C6QsKJEiEJaD@Q3F8s5u<$E+<2(By)JAZSxviTsXg(wKC+O%
zzvV{Z>W3*k?r7~pgmmkbw8-x{Am!eeN)z?cwIHcT2jqgiA(SXo<iO=E?cY80`p#w8
z)O-&?SnwsJ=1VJ-?26&*g88Nr8E=g2onRW^(c+2nJlX)?dmK)tPO0EY-!B!vMCv1)
z-AOW(3WuF+7IdSxMnzrDgnMqVU=|+YFxlY|VeR+Fg<%C@0Xupi0<S7QYJyFTR$}FQ
zzoSAbU>CoCKWKX;!3@L_U=aFUm!M<>ILG}$`bfnadAkLQbI-upV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4
zU)W&&o9V6>MQOk{A%?1(Ozs{Qqlifa7!d*h2?YX1XUk3k8w>yn2@n&u^&ZXMLk+>~
z0HDxvfGrJTMY@$ys#k#t?D63Zq=W#R3eUeT(L61`VGHe?zP;`rnta#-umS)8nA%Rq
literal 0
Hc$@<O00001
diff --git a/t/t7003/trustdb.gpg b/t/t7003/trustdb.gpg
new file mode 100644
index 0000000000000000000000000000000000000000..abace962b8bf84be688a6f27e4ebd0ee7052f210
GIT binary patch
literal 1280
zc${NQFGy!*W@Ke#U|?`dKkdhW9WZj?kU$5c>V~O0xdF0wRNbgLB*4Q^d_AJX`?+Ff
z-%-DI;cZ{#&fat8WrIk{Bh>LSXg$|u;QP1h(CoKf1uliE9{RiD*MZd?h(R(B0AuhN
Ar2qf`
literal 0
Hc$@<O00001
--
1.5.0
^ permalink raw reply related
* Re: [PATCH guilt] make guilt use standard POSIX shell
From: Josef Sipek @ 2007-06-14 16:39 UTC (permalink / raw)
To: Pierre Habouzit; +Cc: git
In-Reply-To: <20070614155826.GN23324@artemis>
On Thu, Jun 14, 2007 at 05:58:26PM +0200, Pierre Habouzit wrote:
> On Thu, Jun 14, 2007 at 05:56:00PM +0200, Pierre Habouzit wrote:
> > On Thu, Jun 14, 2007 at 11:27:02AM -0400, Josef Sipek wrote:
> > > Thanks a lot!
> >
> > Well, worry for the obvious mistakes.
> *sorry
>
> Now, *that* was an interesting typo :P
:)
Ok, pushed to kernel.org. I folded the 2 regression fixing patches into the
right places.
Thanks a lot!
Josef "Jeff" Sipek.
--
Linux, n.:
Generous programmers from around the world all join forces to help
you shoot yourself in the foot for free.
^ permalink raw reply
* Re: [PATCH guilt] make guilt use standard POSIX shell
From: Pierre Habouzit @ 2007-06-14 15:58 UTC (permalink / raw)
To: Josef Sipek, git
In-Reply-To: <20070614155600.GM23324@artemis>
[-- Attachment #1: Type: text/plain, Size: 436 bytes --]
On Thu, Jun 14, 2007 at 05:56:00PM +0200, Pierre Habouzit wrote:
> On Thu, Jun 14, 2007 at 11:27:02AM -0400, Josef Sipek wrote:
> > Thanks a lot!
>
> Well, worry for the obvious mistakes.
*sorry
Now, *that* was an interesting typo :P
--
·O· Pierre Habouzit
··O madcoder@debian.org
OOO http://www.madism.org
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: [PATCH guilt] make guilt use standard POSIX shell
From: Pierre Habouzit @ 2007-06-14 15:56 UTC (permalink / raw)
To: Josef Sipek; +Cc: git
In-Reply-To: <20070614152702.GC934@filer.fsl.cs.sunysb.edu>
[-- Attachment #1: Type: text/plain, Size: 2143 bytes --]
On Thu, Jun 14, 2007 at 11:27:02AM -0400, Josef Sipek wrote:
> On Thu, Jun 14, 2007 at 02:50:55PM +0200, Pierre Habouzit wrote:
> > This patch series makes guilt be able to work with a standard posix shell.
> >
> > This has been tested with bash, zsh, dash and posh acting as /bin/sh.
> >
> > This uses awk and sed a bit more than before, but POSIX awk and sed should be
> > enough. Though GNU find and GNU /bin/echo from the coreutils needs to be
> > there.
> >
> > Here is the shortlog:
> >
> > Pierre Habouzit (7):
> > Regression test suite needs bash, that's OK.
> > guilt(1): Obvious bashisms fixed.
> > guilt(1): simplifications...
> > guilt(1): reimplement push_patch, using a subshell to avoid locals.
> > Easy commands, without bashisms.
> > guilt-status(1): Remove bashisms.
> > Remove last bashisms from remaining commands.
>
> I went though the patches, and it's mostly good (see individual patch
> replies for details). I noticed an indentation issue or two, but I can fix
> that up easily, I can take care of the quoting of `basename $0`.
Thanks.
> The regression suite is little lacking, so I am going to put your updated
> patches onto a special branch, and test it for a while - fixing up any
> potential bugs. (I don't want to be even remotely responsible for people's
> patches turning into empty files :) )
That seems like a very good plan. I just sent the fixes. Hopefully
this should fix major issues right now.
Interestingly enough, benchmarking for runs with different shells as
/bin/sh show:
dash: 1.63s user 3.93s system 102% cpu 5.436 total
posh: 2.02s user 4.29s system 100% cpu 6.260 total
bash: 2.82s user 5.78s system 104% cpu 8.223 total
zsh: 3.70s user 5.86s system 99% cpu 9.626 total
(this is obviously completely not unreliable, but gives some rough
ideas though)
> Thanks a lot!
Well, worry for the obvious mistakes.
--
·O· Pierre Habouzit
··O madcoder@debian.org
OOO http://www.madism.org
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* [PATCH] More regressions fixes.
From: Pierre Habouzit @ 2007-06-14 15:50 UTC (permalink / raw)
To: Josef Jeff Sipek; +Cc: git, Pierre Habouzit
In-Reply-To: <11818254621527-git-send-email-madcoder@debian.org>
+ use awk again to parse git-cat-file properly
+ fixes .new -> .tmp (always use the same suffix to avoid problems)
+ write in foo.tmp and move it, and not the reverse :)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
---
guilt | 28 +++++++++++++++++-----------
1 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/guilt b/guilt
index 58df606..7c78cc7 100755
--- a/guilt
+++ b/guilt
@@ -177,16 +177,22 @@ do_make_header()
exit 2
fi
- git-cat-file -p "$1" | sed -e \
- '1,/^$/ {
- /^author/ {
- s/^author /From: /
- s/ [0-9]* [+-]*[0-9][0-9]*$//
- p
+ git-cat-file -p "$1" | awk '
+ BEGIN{headers=1; firstline=1}
+ /^author / && headers {
+ sub(/^author +/, "");
+ sub(/ [0-9]* [+-]*[0-9][0-9]*$/, "");
+ author=$0
+ }
+ !headers {
+ print
+ if (firstline) {
+ firstline = 0;
+ print "\nFrom: " author;
}
- /^$/p
- d
- }'
+ }
+ /^$/ && headers { headers = 0 }
+ '
}
# usage: do_get_header patchfile
@@ -267,7 +273,7 @@ series_rename_patch()
{
awk -v old="$1" -v new="$2" \
'{ if ($0 == old) print new; else print $0 }' \
- "$series.tmp" > "$series"
+ "$series" > "$series.tmp"
mv "$series.tmp" "$series"
}
@@ -284,7 +290,7 @@ applied_rename_patch()
print substr($0, 0, 41) new;
else
print;
- }' "$applied" > "$applied.new"
+ }' "$applied" > "$applied.tmp"
mv "$applied.tmp" "$applied"
}
--
1.5.2.1
^ permalink raw reply related
* Re: [PATCH] cvsserver: Add some useful commandline options
From: Frank Lichtenheld @ 2007-06-14 15:36 UTC (permalink / raw)
To: Git Mailing List; +Cc: Junio C Hamano
In-Reply-To: <11812282222271-git-send-email-frank@lichtenheld.de>
On Thu, Jun 07, 2007 at 04:57:01PM +0200, Frank Lichtenheld wrote:
> Make git-cvsserver understand some options inspired by
> git-daemon, namely --base-path, --export-all, --strict-paths.
Note that this patch doesn't actually implement --export-all ...
Which I would have caught if I implemented a test for it, which I also
didn't do...
Will send a fix somewhen in the next days.
Gruesse,
--
Frank Lichtenheld <frank@lichtenheld.de>
http://www.djpig.de/
^ permalink raw reply
* Re: pull into dirty working tree
From: Linus Torvalds @ 2007-06-14 15:46 UTC (permalink / raw)
To: Bill Lear; +Cc: git
In-Reply-To: <18033.14520.846510.640130@lisa.zopyra.com>
On Thu, 14 Jun 2007, Bill Lear wrote:
> On Wednesday, June 13, 2007 at 22:21:38 (-0700) Linus Torvalds writes:
> >On Wed, 13 Jun 2007, Bill Lear wrote:
> >>
> >> We have some CVS users who complain that they cannot do a pull
> >> into a dirty working tree, as they could under CVS.
> >
> >Well, a lot of people have told you that the answer is "don't do that",
> >but I actually somewhat disagree.
>
> I have now officially fallen out of my chair.
Well, the thing is, I actually pull into dirty trees all the time. So I
can really see the point of wanting to have some dirty state (you're not
ready to commit it yet), but still wanting to update your tree to some
newer state..
Of course, in the kernel (where I do this - I do it to a much lesser
degree in git too, but for the kernel it's "normal" for me to do it), we
have very good modularization of source code, so I can do the "pull into a
dirty tree" with _current_ git, just because there is almost never a
clash (and if there is, nothing bad happens: the pull won't succeed, and I
can decide to either stash away my diff or just undo it, and then re-pull
afterwards).
But I can also well imagine that other projects aren't quite as modular as
the kernel is. In fact, I pretty much know that for a fact.. We've spent
years splitting things up, just because clashes are nasty.
So I don't think the "pull into a dirty tree" is necessarily a horribly
bad workflow. It *can* be due to bad habits, but it can equally well be
due to perfectly fine habits like having added some debugging code that
you actually want to eventually throw away, but you haven't quite debugged
it totally yet.
For example, maybe the reason you pull is because there's a potential fix
in upstream - you want to keep your debugging code (to _verify_ the fix,
or verify that it wasn't a fix at all).
The fact that some CVS users do it because they are used to it doesn't
_automatically_ make it bad form. They probably have really bad reasons
for doing it (namely the fact that under CVS, you cannot commit to your
tree as aggressively as you can under git, since committing affects
everybody else too), and *those* reasons may not be true under git, but
the other ones (see above) are still what appear to be valid reasons for
allowing this..
So the only reason I'm ambivalent is actually that I suspect it's just
hard to do cleanly. For example, doing it for the fast-forward case is
much easier, but then people will start *wanting* to do it for the more
complex "real merge" case, and will complain when that doesn't work. And
that one really _is_ fundamentally harder.
So it might be easier to take a "git stash ; git pull ; git unstash"
approach instead of making "git pull" handle working tree conflicts
itseld.
Linus
^ permalink raw reply
* Re: [PATCH guilt] make guilt use standard POSIX shell
From: Josef Sipek @ 2007-06-14 15:27 UTC (permalink / raw)
To: Pierre Habouzit; +Cc: git
In-Reply-To: <11818254621527-git-send-email-madcoder@debian.org>
On Thu, Jun 14, 2007 at 02:50:55PM +0200, Pierre Habouzit wrote:
> This patch series makes guilt be able to work with a standard posix shell.
>
> This has been tested with bash, zsh, dash and posh acting as /bin/sh.
>
> This uses awk and sed a bit more than before, but POSIX awk and sed should be
> enough. Though GNU find and GNU /bin/echo from the coreutils needs to be
> there.
>
> Here is the shortlog:
>
> Pierre Habouzit (7):
> Regression test suite needs bash, that's OK.
> guilt(1): Obvious bashisms fixed.
> guilt(1): simplifications...
> guilt(1): reimplement push_patch, using a subshell to avoid locals.
> Easy commands, without bashisms.
> guilt-status(1): Remove bashisms.
> Remove last bashisms from remaining commands.
I went though the patches, and it's mostly good (see individual patch
replies for details). I noticed an indentation issue or two, but I can fix
that up easily, I can take care of the quoting of `basename $0`.
The regression suite is little lacking, so I am going to put your updated
patches onto a special branch, and test it for a while - fixing up any
potential bugs. (I don't want to be even remotely responsible for people's
patches turning into empty files :) )
Thanks a lot!
Josef "Jeff" Sipek.
--
A CRAY is the only computer that runs an endless loop in just 4 hours...
^ permalink raw reply
* Re: [PATCH] guilt(1): Obvious bashisms fixed.
From: Pierre Habouzit @ 2007-06-14 15:18 UTC (permalink / raw)
To: Josef Sipek; +Cc: git
In-Reply-To: <20070614151512.GB934@filer.fsl.cs.sunysb.edu>
[-- Attachment #1: Type: text/plain, Size: 1385 bytes --]
On Thu, Jun 14, 2007 at 11:15:12AM -0400, Josef Sipek wrote:
> On Thu, Jun 14, 2007 at 02:50:57PM +0200, Pierre Habouzit wrote:
> > + function foo { } -> foo() { }
> > + add wrapper for echo -e
> > + couple of '[' bashisms
> > + get rid of easy local variables to remove
> > + avoid cd - (using subshells)
> ....
>
> Just a small nit-pick :)
>
> > diff --git a/guilt b/guilt
> > index 2ae76f8..80f3faf 100755
> > --- a/guilt
> > +++ b/guilt
> > @@ -20,7 +20,29 @@ SUBDIRECTORY_OK=1
> ....
> > +guilt_commands()
> > {
> > local command
> > for command in $0-*
> > @@ -32,7 +54,7 @@ function guilt_commands
> > done
> > }
> >
> > -if [ `basename $0` = "guilt" ]; then
> > +if [ "`basename $0`" = "guilt" ]; then
>
> You added quotes here - that's ok....
>
> > # being run as standalone
> >
> > # by default, we shouldn't fail
> > @@ -58,7 +80,7 @@ if [ `basename $0` = "guilt" ]; then
>
> But did not add them here.... :)
heh, I tried my best, I've no automated tool for that, only my eyes
and thise code will break iff `basename $0` has spaces in it, which is
rather crazy anyways. But you're welcome to add the missing ones *sigh*
--
·O· Pierre Habouzit
··O madcoder@debian.org
OOO http://www.madism.org
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: [PATCH] guilt(1): simplifications...
From: Pierre Habouzit @ 2007-06-14 15:16 UTC (permalink / raw)
To: Josef Sipek; +Cc: git
In-Reply-To: <20070614145845.GA934@filer.fsl.cs.sunysb.edu>
[-- Attachment #1: Type: text/plain, Size: 3712 bytes --]
On Thu, Jun 14, 2007 at 10:58:45AM -0400, Josef Sipek wrote:
> On Thu, Jun 14, 2007 at 02:50:58PM +0200, Pierre Habouzit wrote:
> > # usage: do_make_header <hash>
> > do_make_header()
> > {
> > - # which revision do we want to work with?
> > - local rev="$1"
> > -
> > # we should try to work with commit objects only
> > - if [ `git-cat-file -t "$rev"` != "commit" ]; then
> > - echo "Hash $rev is not a commit object" >&2
> > + if [ `git-cat-file -t "$1"` != "commit" ]; then
> > + echo "Hash $1 is not a commit object" >&2
> > echo "Aborting..." >&2
> > exit 2
> > fi
> >
> > - # get the author line from the commit object
> > - local author=`git-cat-file -p "$rev" | grep -e '^author ' | head -1`
> > -
> > - # strip the timestamp & '^author ' string
> > - author=`echo "$author" | sed -e 's/^author //' -e 's/ [0-9]* [+-]*[0-9][0-9]*$//'`
> > -
> > - git-cat-file -p "$rev" | awk "
> > -BEGIN{ok=0}
> > -(ok==1){print \$0; print \"\nFrom: $author\"; ok=2; next}
> > -(ok==2){print \$0}
> > -/^\$/ && (ok==0){ok=1}
> > -"
> > + git-cat-file -p "$1" | sed -e \
> > + '1,/^$/ {
> > + /^author/ {
> > + s/^author /From: /
> > + s/ [0-9]* [+-]*[0-9][0-9]*$//
> > + p
> > + }
> > + /^$/p
> > + d
> > + }'
>
> You changed the output slightly. The original awk script outputed:
>
> >>>>>
> the first line of the commit message
>
> From: foo@....
>
> remainder of the commit message
> <<<<<
>
> Yours outputs:
>
> >>>>>
> From: foo@....
>
> the entire commit message
> <<<<<
>
> I'd like to keep the previous format as it makes it easier to grab the first
> line of each patch file to get the "short summary" (assuming you follow the
> kernel/git/guilt commit message conventions). This doesn't make anything in
> guilt easier, it just makes the patch files more friendly to other tools one
> might use. (Especially if they grab the first line and use it as the subject
> in emails.)
damn, I thought I had checked that thouroughly, I'll see that in
details then. and will give you a new patch.
> > @@ -283,10 +264,11 @@ series_remove_patch()
> > # usage: series_rename_patch <oldname> <newname>
> > series_rename_patch()
> > {
> > - local old=`echo "$1" | sed -e 's,/,\\\\/,g'`
> > - local new=`echo "$2" | sed -e 's,/,\\\\/,g'`
> > + awk -v old="$1" -v new="$2" \
> > + '{ if ($0 == old) print new; else print $0 }' \
> > + "$series.tmp" > "$series"
>
> Shouldn't that be '"$series" > "$series.tmp"' ?
>
> > - sed -i -e "s/^$old\$/$new/" "$series"
> > + mv "$series.tmp" "$series"
> > }
> >
> > # Beware! This is one of the few (only?) places where we modify the applied
> > @@ -295,10 +277,15 @@ series_rename_patch()
> > # usage: applied_rename_patch <oldname> <newname>
> > applied_rename_patch()
> > {
> > - local old=`echo "$1" | sed -e 's,/,\\\\/,g'`
> > - local new=`echo "$2" | sed -e 's,/,\\\\/,g'`
> > + awk -v old="$1" -v new="$2" \
> > + 'BEGIN{FS=":"}
> > + { if ($1 ~ /^[0-9a-f]*$/ && length($1) == 40 && substr($0, 42) == old)
> > + print substr($0, 0, 41) new;
> > + else
> > + print;
> > + }' "$applied" > "$applied.new"
> ^^^^
>
> > - sed -i -e "s/^\\([0-9a-f]\\{40\\}\\):$old\$/\\1:$new/" "$applied"
> > + mv "$applied.tmp" "$applied"
> ^^^^
>
> ..new or .tmp?
Those are obvious blatant mistakes. THe fixes will be available in the
coming patch as well.
--
·O· Pierre Habouzit
··O madcoder@debian.org
OOO http://www.madism.org
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: [PATCH] guilt(1): Obvious bashisms fixed.
From: Josef Sipek @ 2007-06-14 15:15 UTC (permalink / raw)
To: Pierre Habouzit; +Cc: git
In-Reply-To: <1181825462590-git-send-email-madcoder@debian.org>
On Thu, Jun 14, 2007 at 02:50:57PM +0200, Pierre Habouzit wrote:
> + function foo { } -> foo() { }
> + add wrapper for echo -e
> + couple of '[' bashisms
> + get rid of easy local variables to remove
> + avoid cd - (using subshells)
...
Just a small nit-pick :)
> diff --git a/guilt b/guilt
> index 2ae76f8..80f3faf 100755
> --- a/guilt
> +++ b/guilt
> @@ -20,7 +20,29 @@ SUBDIRECTORY_OK=1
...
> +guilt_commands()
> {
> local command
> for command in $0-*
> @@ -32,7 +54,7 @@ function guilt_commands
> done
> }
>
> -if [ `basename $0` = "guilt" ]; then
> +if [ "`basename $0`" = "guilt" ]; then
You added quotes here - that's ok....
> # being run as standalone
>
> # by default, we shouldn't fail
> @@ -58,7 +80,7 @@ if [ `basename $0` = "guilt" ]; then
But did not add them here.... :)
Josef "Jeff" Sipek.
--
A CRAY is the only computer that runs an endless loop in just 4 hours...
^ permalink raw reply
* Re: [PATCH] Introduce file with the common default build-time items.
From: Shawn O. Pearce @ 2007-06-14 15:09 UTC (permalink / raw)
To: Eygene Ryabinkin; +Cc: git
In-Reply-To: <20070614095654.GT86872@void.codelabs.ru>
Eygene Ryabinkin <rea-git@codelabs.ru> wrote:
>
> Thu, Jun 14, 2007 at 12:36:33AM -0400, Shawn O. Pearce wrote:
> > Eygene Ryabinkin <rea-git@codelabs.ru> wrote:
> > > Words 'wish' and 'tclsh' are scattered across at least three files,
> > > but they are tied to the same entities. To ease the maintenance
> > > and remove errors, these configuration items were gathered into the
> > > separate file named 'common-make-vars.def'.
...
> > A good idea to try and make these all common, but you cannot do this,
> > or at least this part of the patch.
>
> OK, but then may be it will be logical to put Tcl/Tk-related variables
> to the git-gui/common-make-vars.def? I am a little worried about
> this, because gitk is the part of the git.git and it should get the
> variables too. The drawback here is if you will update your git-gui
> repo, then git.git will need to wait for your import to get the
> changes in the variables. And this will seriously couple git.git
> and git-gui, though I don't know if it is good or bad.
No, because Junio has already stated a desire to remove git-gui.git
from git.git and convert it to a proper subproject by the time of
Git 1.6. That means the git-gui/ subdirectory will become optional,
though I imagine most git-gui users will still have it. But not
all Git users are git-gui users. ;-)
The best we can do is let the user pick their TCL_PATH and
TCLTK_PATH up in git's own Makefile, and have it pass down into
git-gui's Makefile when git-gui is being built from within git.
That is the arrangement we currently have.
--
Shawn.
^ permalink raw reply
* Re: [PATCH] guilt(1): simplifications...
From: Josef Sipek @ 2007-06-14 14:58 UTC (permalink / raw)
To: Pierre Habouzit; +Cc: git
In-Reply-To: <11818254621458-git-send-email-madcoder@debian.org>
On Thu, Jun 14, 2007 at 02:50:58PM +0200, Pierre Habouzit wrote:
> + using awk to avoid local variables
> + more clever with sed
> + reimplement munge_hash_range with case
>
> and some whitespace problems.
Few tiny comments.
Thanks for the patches.
...
> # usage: do_make_header <hash>
> do_make_header()
> {
> - # which revision do we want to work with?
> - local rev="$1"
> -
> # we should try to work with commit objects only
> - if [ `git-cat-file -t "$rev"` != "commit" ]; then
> - echo "Hash $rev is not a commit object" >&2
> + if [ `git-cat-file -t "$1"` != "commit" ]; then
> + echo "Hash $1 is not a commit object" >&2
> echo "Aborting..." >&2
> exit 2
> fi
>
> - # get the author line from the commit object
> - local author=`git-cat-file -p "$rev" | grep -e '^author ' | head -1`
> -
> - # strip the timestamp & '^author ' string
> - author=`echo "$author" | sed -e 's/^author //' -e 's/ [0-9]* [+-]*[0-9][0-9]*$//'`
> -
> - git-cat-file -p "$rev" | awk "
> -BEGIN{ok=0}
> -(ok==1){print \$0; print \"\nFrom: $author\"; ok=2; next}
> -(ok==2){print \$0}
> -/^\$/ && (ok==0){ok=1}
> -"
> + git-cat-file -p "$1" | sed -e \
> + '1,/^$/ {
> + /^author/ {
> + s/^author /From: /
> + s/ [0-9]* [+-]*[0-9][0-9]*$//
> + p
> + }
> + /^$/p
> + d
> + }'
You changed the output slightly. The original awk script outputed:
>>>>>
the first line of the commit message
From: foo@....
remainder of the commit message
<<<<<
Yours outputs:
>>>>>
From: foo@....
the entire commit message
<<<<<
I'd like to keep the previous format as it makes it easier to grab the first
line of each patch file to get the "short summary" (assuming you follow the
kernel/git/guilt commit message conventions). This doesn't make anything in
guilt easier, it just makes the patch files more friendly to other tools one
might use. (Especially if they grab the first line and use it as the subject
in emails.)
> @@ -260,17 +246,12 @@ head_check()
> # usage: series_insert_patch <patchname>
> series_insert_patch()
> {
> - local top=`get_top | sed -e 's,/,\\\\/,g'`
> - local new=`echo "$1" | sed -e 's,/,\\\\/,g'`
> -
> - if [ ! -z "$top" ]; then
> - sed -i -e "s/^$top\$/$top\n$new/" "$series"
> - else
> - # don't use $new here as it would only complicate things
> - echo "$1" > "$series.tmp"
> - cat "$series" >> "$series.tmp"
> - mv "$series.tmp" "$series"
> - fi
> + awk -v top="`get_top`" -v new="$1" '{
> + if (top == "" && NR == 1) print new;
> + print $0;
> + if (top != "" && top == $0) print new;
> + }' "$series" > "$series.tmp"
> + mv "$series.tmp" "$series"
> }
>
> # usage: series_remove_patch <patchname>
> @@ -283,10 +264,11 @@ series_remove_patch()
> # usage: series_rename_patch <oldname> <newname>
> series_rename_patch()
> {
> - local old=`echo "$1" | sed -e 's,/,\\\\/,g'`
> - local new=`echo "$2" | sed -e 's,/,\\\\/,g'`
> + awk -v old="$1" -v new="$2" \
> + '{ if ($0 == old) print new; else print $0 }' \
> + "$series.tmp" > "$series"
Shouldn't that be '"$series" > "$series.tmp"' ?
> - sed -i -e "s/^$old\$/$new/" "$series"
> + mv "$series.tmp" "$series"
> }
>
> # Beware! This is one of the few (only?) places where we modify the applied
> @@ -295,10 +277,15 @@ series_rename_patch()
> # usage: applied_rename_patch <oldname> <newname>
> applied_rename_patch()
> {
> - local old=`echo "$1" | sed -e 's,/,\\\\/,g'`
> - local new=`echo "$2" | sed -e 's,/,\\\\/,g'`
> + awk -v old="$1" -v new="$2" \
> + 'BEGIN{FS=":"}
> + { if ($1 ~ /^[0-9a-f]*$/ && length($1) == 40 && substr($0, 42) == old)
> + print substr($0, 0, 41) new;
> + else
> + print;
> + }' "$applied" > "$applied.new"
^^^^
> - sed -i -e "s/^\\([0-9a-f]\\{40\\}\\):$old\$/\\1:$new/" "$applied"
> + mv "$applied.tmp" "$applied"
^^^^
.new or .tmp?
Josef "Jeff" Sipek.
--
The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all progress
depends on the unreasonable man.
- George Bernard Shaw
^ permalink raw reply
* Re: pull into dirty working tree
From: Nicolas Pitre @ 2007-06-14 14:25 UTC (permalink / raw)
To: Steven Grimm; +Cc: Junio C Hamano, Linus Torvalds, Bill Lear, git
In-Reply-To: <4670F6FD.4060704@midwinter.com>
On Thu, 14 Jun 2007, Steven Grimm wrote:
> You can view this in terms of being a leg up for people who *do* want to use
> git, but are in environments where they are unable to convince or force
> everyone else to adopt git-style workflows. I think it's telling that almost
> all the discussions about this kind of feature are of the form, "I'm trying to
> convince my team to use git, and they find it no good because of X." It's the
> person trying to sell git to the group, presumably so they can use it
> themselves without having to go through a CVS or Subversion or p4 gateway,
> that this stuff really helps. That the rest of the team will benefit down the
> road too is nice but probably not the immediate selfish personal goal of the
> people who are asking for this kind of feature.
Personally, I think there is a point where it isn't worth trying to
convert the world. If people consider GIT bad and unwilling to use it
because of X or Z then they probably better stay with CVS. There is a
limit to how backward bending should GIT do to accomodate everyone,
especially if it is about compromize in its usage model just to make
life easier for people who want to preserve their inferior work flow.
This being said, I don't claim to have a particular opinion about the
issue discussed in this thread. Simply that things should be decided on
a technical basis and be justified with good arguments. Saying that "I
can't convince my co-workers to use GIT if it doesn't do X" is _not_ a
good argument.
Nicolas
^ permalink raw reply
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