* Re: What's cooking in git.git (topics)
From: Pierre Habouzit @ 2007-11-12 14:53 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Junio C Hamano, git
In-Reply-To: <Pine.LNX.4.64.0711121232370.4362@racer.site>
[-- Attachment #1: Type: text/plain, Size: 1255 bytes --]
On Mon, Nov 12, 2007 at 12:33:19PM +0000, Johannes Schindelin wrote:
> Hi,
>
> On Mon, 12 Nov 2007, Pierre Habouzit wrote:
>
> > On Mon, Nov 12, 2007 at 12:21:34PM +0000, Johannes Schindelin wrote:
> >
> > > On Sun, 11 Nov 2007, Junio C Hamano wrote:
> > >
> > > > * js/rebase-detached (Thu Nov 8 18:19:08 2007 +0000) 1 commit
> > > > + rebase: operate on a detached HEAD
> > >
> > > Note: this might have a subtle bug when the last patch in the series
> > > failed. If I was not too tired this morning (which might well have
> > > been the case), rebase could not switch back to the branch correctly
> > > with this.
> >
> > OOOH so this was what happened to me today then. I did a rebase, there
> > was a commit to skip, the last one, and I ended up on a detached head.
> > As I didn't had my coffee yet, I assumed this was my fault and did
> > something stupid. So after all it seems it wasn't the case then :)
>
> Thanks for acknowleding, and sorry for the bug.
well, shit happens, I'm running next especially to spot those :)
--
·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: What's cooking in git.git (topics)
From: Johannes Schindelin @ 2007-11-12 15:02 UTC (permalink / raw)
To: Steffen Prohaska; +Cc: Junio C Hamano, git
In-Reply-To: <087FCF8E-74BF-42EA-B7E2-4622DD0F5F9B@zib.de>
Hi,
On Mon, 12 Nov 2007, Steffen Prohaska wrote:
> On Nov 12, 2007, at 1:21 PM, Johannes Schindelin wrote:
>
> > > * sp/refspec-match (Sun Nov 11 15:01:48 2007 +0100) 4 commits
> > > - refactor fetch's ref matching to use refname_match()
> > > - push: use same rules as git-rev-parse to resolve refspecs
> > > - add refname_match()
> > > - push: support pushing HEAD to real branch name
> > >
> > > This changes the semantics slightly but I think it is a move in
> > > the right direction.
> >
> > We could add a "--matching" option and output a warning when it is not
> > passed. I would like this pretty soon, and would not be sad if it went
> > into 'next' before this topic.
>
> Is this the road towards
> 1) "git push --matching" push matching branches.
> 2) "git push --current" push only current branch.
> 3) "git push" report error if the config does not contain a Push line.
> (after it reported a warning for a while).
AFAIAC yes. Maybe in two years (that's twice an eternity in git time
scales):
4) make "git push --current" the default.
> I'd like to see this too. Unfortunately it's unlikely that I'll start
> working on it before next weekend.
>
> "--matching" would be a no-op at this time. Only a warning would be printed
> if it is missing. Right?
Right.
Ciao,
Dscho
^ permalink raw reply
* [PATCH] git-commit: Add tests for invalid usage of -a/--interactive with paths
From: Björn Steinbrink @ 2007-11-12 15:15 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vwsso3poo.fsf@gitster.siamese.dyndns.org>
git-commit was/is broken in that it accepts paths together with -a or
--interactive, which it shouldn't. There tests check those usage errors.
Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
---
> [Stalled]
>
> * bs/maint-commit-options (Mon Nov 5 20:36:33 2007 +0100) 1 commit
> - git-commit.sh: Fix usage checks regarding paths given when they do
> not make sense
>
> This is meant to go to 'maint' but needs test script to exhibit
> the existing breakage and demonstrate the fix.
>
> The test will help catching future regression even after we
> replace git-commit with Kristian's rewrite in C.
Sorry, didn't take your comment to that patch as a request to provide
tests. Anyway, here they are :-) I hope I got the commit message/comment
formatting right this time.
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index 4dc35bd..9dba104 100644
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -34,6 +34,16 @@ test_expect_failure \
"git-commit -C HEAD -m illegal"
test_expect_failure \
+ "using paths with -a" \
+ "echo King of the bongo >file &&
+ git-commit -m foo -a file"
+
+test_expect_failure \
+ "using paths with --interactive" \
+ "echo bong-o-bong >file &&
+ echo 7 | git-commit -m foo --interactive file"
+
+test_expect_failure \
"using invalid commit with -C" \
"git-commit -C bogus"
^ permalink raw reply related
* Re: [PATCH] status&commit: Teach them to show submodule commit summary
From: Ping Yin @ 2007-11-12 15:17 UTC (permalink / raw)
To: Ralf Wildenhues, Ping Yin, git
In-Reply-To: <20071112144605.GA16791@ins.uni-bonn.de>
On Nov 12, 2007 10:46 PM, Ralf Wildenhues <Ralf.Wildenhues@gmx.de> wrote:
> Hello,
>
> A couple of portability nits:
>
> * Ping Yin wrote on Mon, Nov 12, 2007 at 03:21:17PM CET:
> [...]
> > +
> > + # TODO: quote module names containing space or tab
> > + test -n "$modules" && echo -e "# Submodules modifiled: "$modules"\n#"
>
> Typo: s/modifiled/modified/
Oops
>
> Then, "echo -e" is not portable (and not used elsewhere in git), but you
> can just use this instead:
> test ... && { echo "# ..."; echo "#"; }
See
>
> Also, it so happens you leave $modules outside quotes which will drop
> multiple adjacent white spaces. Did you mean to use
> echo "# Submodules modified: \"$modules\""
I leave $modules outside quotes to let "\n" change to <space> by auto
word splitting.
It actually eats white spaces in the module names. So any suggestion
to handle this case?
To handles module names with spaces, is it ok to display as follows?
Submodules modified: sm1 "sm name with space"
Any good way to only add quoting for names with spaces?
> You can instead just use a literal newline:
> IFS='
> '
> (minus the indentation). And add a literal carriage return if need be
> (is that really needed on Mac OS?), though you may want to enclose that
> in another pair of quotes to avoid it being "optimized" away by some
> editor.
I just guess '\r' is need for Mac OS because i havn't Mac OS environment.
BTW, how to add a literal carriage return?
>
> Cheers,
> Ralf
>
--
Ping Yin
^ permalink raw reply
* Re: [PATCH,RFC 1/2] Make the list of common commands more exclusive
From: Theodore Tso @ 2007-11-12 15:20 UTC (permalink / raw)
To: Andreas Ericsson; +Cc: Junio C Hamano, Git Mailing List
In-Reply-To: <4738292E.2020103@op5.se>
On Mon, Nov 12, 2007 at 11:21:34AM +0100, Andreas Ericsson wrote:
>
> git format-patch could probably go in, but skip the others. I've never
> used git cherry in my entire life and it's not, strictly speaking,
> necessary for users to have it. There are other and easier ways to
> find the same information.
How useful it is depends on the project, definitely. The Linux kernel
doesn't have the "what's cooking" emails, and is very fast-moving, so
a day after you submit your patch set via e-mail, and then you do a
pull, and several hundred commits come spilling down from upstream,
git-cherry is incredibly useful to see what was accepted and what
wasn't. :-)
> I'd keep cherry-pick though. It's incredibly useful, and especially
> when a commit ends up on the wrong branch which is something newbies
> are likely to do when they start trying out the topic-branch workflow.
> I still do it sometimes, but hardly ever stop thinking about it since
> it's so easy to fix thanks to cherry-pick.
How often cherry-pick is useful is probably also very project
specific, and depends on how branchy a project happens to be, and how
aggressively patches get merged into the master development line. For
a project that is extremely linear, with few branches, cherry-pick is
less useful; I didn't have any occasion to use it for quite a while,
and certainly not while I was a git beginner.
- Ted
^ permalink raw reply
* Re: [PATCH] tests: git push mirror mode tests V2
From: Andy Whitcroft @ 2007-11-12 15:25 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vsl3frxpk.fsf@gitster.siamese.dyndns.org>
On Fri, Nov 09, 2007 at 12:05:43PM -0800, Junio C Hamano wrote:
> Andy Whitcroft <apw@shadowen.org> writes:
>
> > +test_expect_success 'push mirror does not create new branches' '
> > +
> > + mk_repo_pair &&
> > + (
> > + cd master &&
> > + echo one >foo && git add foo && git commit -m one &&
> > + git push --mirror up
> > + ) &&
> > + master_master=$(cd master && git show-ref -s --verify refs/heads/master) &&
> > + mirror_master=$(cd mirror && git show-ref -s --verify refs/heads/master) &&
> > + test "$master_master" = "$mirror_master"
> > +
> > +'
>
> I am quite puzzled by this and many other "does not" in the test
> description. The --mirror option is advertised as
>
> - newly created will be pushed;
> - locally updated will be force pushed;
> - locally deleted will be removed.
>
> which makes sense as we do want these things to happen for
> "mirrors". Indeed the above updates master branch at the master
> repository and makes sure that change is propagated to the
> mirror repository. The description should read "push mirror
> creates new branches" shouldn't it?
Indeed, I think the problem was a miss-understanding of the example I
copied from. I think partly I thought that the message was only
displayed on failure. Which is firstly demonstrably false, and secondly
I am not consistent in applying that false knowledge.
If these are not already fixed up in pu I will check and sort them out.
-apw
^ permalink raw reply
* git config error message
From: Jon Smirl @ 2007-11-12 15:35 UTC (permalink / raw)
To: Git Mailing List
I'm not in a git repo, this error message is misleading.
jonsmirl@terra:~/foo$ git config remote.origin.url
http://git.digispeaker.com/projects/digispeaker-kernel.git
could not lock config file
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply
* Re: Cloning from kernel.org, then switching to another repo
From: Jon Smirl @ 2007-11-12 15:36 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Git Mailing List
In-Reply-To: <Pine.LNX.4.64.0711121412410.4362@racer.site>
On 11/12/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> On Mon, 12 Nov 2007, Jon Smirl wrote:
>
> > I'd like to do this sequence, but I can't figure out how without editing
> > the config file. There doesn't seem to be a simple command to move the
> > origin.
> >
> > git clone linus
> > move origin to digispeaker.git
>
> AKA "git config remote.origin.url <your-digispeaker-url-here>"
There is more to this:
jonsmirl@terra:~/foo$ git clone
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
ds
clone.....
jonsmirl@terra:~/foo/ds$ git config remote.origin.url
http://git.digispeaker.com/projects/digispeaker-kernel.git
jonsmirl@terra:~/foo/ds$ git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me either. Please
name which branch you want to merge on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details on the refspec.
If you often merge with the same branch, you may want to
configure the following variables in your configuration
file:
branch.master.remote = <nickname>
branch.master.merge = <remote-ref>
remote.<nickname>.url = <url>
remote.<nickname>.fetch = <refspec>
See git-config(1) for details.
jonsmirl@terra:~/foo/ds$
>
> > git pull
>
> Hth,
> Dscho
>
>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply
* Re: [PATCH] Include diff options in the git-log manpage
From: Miklos Vajna @ 2007-11-12 15:37 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <1193929060-6183-2-git-send-email-vmiklos@frugalware.org>
[-- Attachment #1: Type: text/plain, Size: 670 bytes --]
On Thu, Nov 01, 2007 at 03:57:40PM +0100, Miklos Vajna <vmiklos@frugalware.org> wrote:
> Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
> ---
>
> Recently I wanted to see what git log -M does but actually I was not able to
> find it in the manpage, finally figured out that all the diff options are
> missing from here.
>
> Removing -p as it's already in diff-options.txt.
>
> If this patch OK, then I would like to send a similar patch to
> git-rev-list.txt, too.
>
> Documentation/git-log.txt | 5 ++---
> 1 files changed, 2 insertions(+), 3 deletions(-)
could somebody please comment this patch? does it look ok?
thanks,
- VMiklos
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: [PATCH] status&commit: Teach them to show submodule commit summary
From: Jakub Narebski @ 2007-11-12 15:37 UTC (permalink / raw)
To: git
In-Reply-To: <1194877277-31777-1-git-send-email-pkufranky@gmail.com>
Ping Yin wrote:
> ---
> Documentation/git-commit.txt | 10 +++++
> Documentation/git-status.txt | 3 +
> git-commit.sh | 90 ++++++++++++++++++++++++++++++++++++++++--
> 3 files changed, 99 insertions(+), 4 deletions(-)
Shouldn't you also modify Documentation/config.txt ?
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: git 1.5.3.5 error over NFS
From: Bill Lear @ 2007-11-12 15:39 UTC (permalink / raw)
To: Alex Riesen; +Cc: git
In-Reply-To: <20071109232106.GA3435@steel.home>
On Saturday, November 10, 2007 at 00:21:06 (+0100) Alex Riesen writes:
>Bill Lear, Fri, Nov 09, 2007 16:31:39 +0100:
>> I've brought this up before, but I don't recall a resolution to it.
>>
>> We have an NFS-mounted filesystem, and git pull is choking on it.
>>
>> % uname -a
>> Linux uhlr.zopyra.com 2.6.9-42.0.2.ELsmp #1 SMP Wed Aug 23 13:38:27 BST 2006 x86_64 x86_64 x86_64 GNU/Linux
>>
>> % git --version
>> git version 1.5.3.5
>>
>> % git pull
>> remote: Generating pack...
>> remote: Done counting 998 objects.
>> remote: Result has 836 objects.
>> remote: Deltifying 836 objects.
>> remote: 100% (836/836) done
>> Indexing 836 objects...
>> remote: Total 836 (delta 526), reused 688 (delta 380)
>> 100% (836/836) done
>> Resolving 526 deltas...
>> fatal: cannot pread pack file: No such file or directory
>
>Could you please strace it? With strace -ff?
>
>> fatal: index-pack died with error code 128
>> fatal: Fetch failure: git://source/repo
>>
>> I looked through the archives of this list and did not see a final
>> resolution, other than a suspected bug in the OS NFS code.
>
>Strace, just to be on the safe side
Ok, I've done the strace -ff. It has generated 176 strace.out.<pid>
files. I have placed a tarball of these files on my home server:
http://www.zopyra.com/~rael/git/git-trace.tar.bz2
The file strace.out.25526 has, at the very end:
[...]
open("/etc/mtab", O_RDONLY) = 4
fstat64(0x4, 0xffff6810) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0x1000) = 0xfffffffff7ffd000
read(4, "/dev/sda1 / ext3 rw 0 0\nnone /pr"..., 4096) = 503
close(4) = 0
munmap(0xf7ffd000, 4096) = 0
open("/proc/meminfo", O_RDONLY) = 4
fstat64(0x4, 0xffff6c7c) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0x1000) = 0xfffffffff7ffd000
read(4, "MemTotal: 16396892 kB\nMemFre"..., 1024) = 672
close(4) = 0
munmap(0xf7ffd000, 4096) = 0
write(2, "Resolving 551 deltas.\n", 22) = 22
pread64(3, "", 242, 541) = 0
write(2, "fatal: ", 7) = 7
write(2, "cannot pread pack file: Success", 31) = 31
write(2, "\n", 1) = 1
exit_group(128) = ?
Here is the clipped output of running the strace command:
[...]
[ Process PID=25347 runs in 32 bit mode. ]
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
[ Process PID=25347 runs in 64 bit mode. ]
[ Process PID=25349 runs in 32 bit mode. ]
[...]
[ Process PID=25366 runs in 64 bit mode. ]
[ Process PID=25365 runs in 32 bit mode. ]
ptrace: umoven: Input/output error
[ Process PID=25366 runs in 64 bit mode. ]
[ Process PID=25365 runs in 32 bit mode. ]
[...]
[ Process PID=25365 runs in 32 bit mode. ]
[ Process PID=25366 runs in 64 bit mode. ]
ptrace: umoven: Input/output error
[ Process PID=25365 runs in 32 bit mode. ]
[ Process PID=25366 runs in 64 bit mode. ]
[...]
[ Process PID=25385 runs in 32 bit mode. ]
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
[...]
[ Process PID=25385 runs in 64 bit mode. ]
[ Process PID=25482 runs in 32 bit mode. ]
[ Process PID=25396 runs in 64 bit mode. ]
[ Process PID=25524 runs in 32 bit mode. ]
remote: Generating pack...
remote: Done counting 1052 objects.
remote: Result has 882 objects.
remote: Deltifying 882 objects.
100% (882/882) done82) done
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
umovestr: Input/output error
Indexing 882 objects.
100% (882/882) done
Resolving 551 deltas.
remote: Total 882 (delta 551), reused 716 (delta 387)
fatal: cannot pread pack file: Success
fatal: index-pack died with error code 128
[ Process PID=25522 runs in 64 bit mode. ]
Fetch failure: git://source/fusion
Bill
^ permalink raw reply
* Re: [PATCH] status&commit: Teach them to show submodule commit summary
From: Ping Yin @ 2007-11-12 15:46 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <fh9rv5$g06$1@ger.gmane.org>
On Nov 12, 2007 11:37 PM, Jakub Narebski <jnareb@gmail.com> wrote:
> Ping Yin wrote:
>
> > ---
> > Documentation/git-commit.txt | 10 +++++
> > Documentation/git-status.txt | 3 +
> > git-commit.sh | 90 ++++++++++++++++++++++++++++++++++++++++--
> > 3 files changed, 99 insertions(+), 4 deletions(-)
>
> Shouldn't you also modify Documentation/config.txt ?
Oh, I'll supplement later
>
> --
> Jakub Narebski
> Warsaw, Poland
> ShadeHawk on #git
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Ping Yin
^ permalink raw reply
* [PATCH] push mirroring update test titles
From: Andy Whitcroft @ 2007-11-12 15:48 UTC (permalink / raw)
To: git, Junio C Hamano
Fix up the test titles which are incorrectly in the negative.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
This probabally should be folded down into the
current tests patch. If you want me to do that
and resubmit, yell at me.
t/t5517-push-mirror.sh | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/t/t5517-push-mirror.sh b/t/t5517-push-mirror.sh
index 0fc6778..ed3fec1 100755
--- a/t/t5517-push-mirror.sh
+++ b/t/t5517-push-mirror.sh
@@ -31,7 +31,7 @@ mk_repo_pair () {
# BRANCH tests
-test_expect_success 'push mirror does not create new branches' '
+test_expect_success 'push mirror creates new branches' '
mk_repo_pair &&
(
@@ -45,7 +45,7 @@ test_expect_success 'push mirror does not create new branches' '
'
-test_expect_success 'push mirror does not update existing branches' '
+test_expect_success 'push mirror updates existing branches' '
mk_repo_pair &&
(
@@ -61,7 +61,7 @@ test_expect_success 'push mirror does not update existing branches' '
'
-test_expect_success 'push mirror does not force update existing branches' '
+test_expect_success 'push mirror force updates existing branches' '
mk_repo_pair &&
(
@@ -79,7 +79,7 @@ test_expect_success 'push mirror does not force update existing branches' '
'
-test_expect_success 'push mirror does not remove branches' '
+test_expect_success 'push mirror removes branches' '
mk_repo_pair &&
(
@@ -97,7 +97,7 @@ test_expect_success 'push mirror does not remove branches' '
'
-test_expect_success 'push mirror does not add, update and remove branches together' '
+test_expect_success 'push mirror adds, updates and removes branches together' '
mk_repo_pair &&
(
@@ -125,7 +125,7 @@ test_expect_success 'push mirror does not add, update and remove branches togeth
# TAG tests
-test_expect_success 'push mirror does not create new tags' '
+test_expect_success 'push mirror creates new tags' '
mk_repo_pair &&
(
@@ -140,7 +140,7 @@ test_expect_success 'push mirror does not create new tags' '
'
-test_expect_success 'push mirror does not update existing tags' '
+test_expect_success 'push mirror updates existing tags' '
mk_repo_pair &&
(
@@ -158,7 +158,7 @@ test_expect_success 'push mirror does not update existing tags' '
'
-test_expect_success 'push mirror does not force update existing tags' '
+test_expect_success 'push mirror force updates existing tags' '
mk_repo_pair &&
(
@@ -179,7 +179,7 @@ test_expect_success 'push mirror does not force update existing tags' '
'
-test_expect_success 'push mirror does not remove tags' '
+test_expect_success 'push mirror removes tags' '
mk_repo_pair &&
(
@@ -197,7 +197,7 @@ test_expect_success 'push mirror does not remove tags' '
'
-test_expect_success 'push mirror does not add, update and remove tags together' '
+test_expect_success 'push mirror adds, updates and removes tags together' '
mk_repo_pair &&
(
^ permalink raw reply related
* Re: [PATCH] status&commit: Teach them to show submodule commit summary
From: Johannes Sixt @ 2007-11-12 15:59 UTC (permalink / raw)
To: Ping Yin; +Cc: Git Mailing List
In-Reply-To: <1194877277-31777-1-git-send-email-pkufranky@gmail.com>
Ping Yin schrieb:
> git status/commit just treats submodules as ordinary files when reporting status
> changes. However, one may also wonder how submodules change (the commits).
>
> This commit teaches git status/commit to additionally show commit summary of
> user-cared (i.e. checked out) modified submodules since HEAD (or HEAD^ if
> --amend option is on). For submodules deleted or initially added, commit summary
> are not shown.
In general, I like the idea (as I've already pointed out).
But at this time git-commit is about to be made a builtin, and since your
implementation contains a lot of non-portable constructs ($'', >&) and a new
dependency on awk (and, hence, has little chances of being accepted), I
suggest that you stay tuned, and implement this in the forth-coming
builtin-commit.c.
> A configuration variable 'submodule.status' is used to turn this summary
> behaviour on or off (default off). Also --submodule and --no-submodule options
> are added.
There is already 'status.color', I suggest the configuration to become
'status.submoduleSummary'.
-- Hannes
^ permalink raw reply
* [PATCH] git-send-email: show all headers when sending mail
From: David D. Kilzer @ 2007-11-12 16:01 UTC (permalink / raw)
To: gitster; +Cc: git, David D. Kilzer
As a git newbie, it was confusing to set an In-Reply-To header but then
not see it printed when the git-send-email command was run.
This patch prints all headers that would be sent to sendmail or an SMTP
server instead of only printing From, Subject, Cc, To. It also removes
the now-extraneous Date header after the "Log says" line.
Added test to t/t9001-send-email.sh.
Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net>
---
I'd like to see this applied to the maint branch.
git-send-email.perl | 4 ++--
t/t9001-send-email.sh | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+), 2 deletions(-)
diff --git a/git-send-email.perl b/git-send-email.perl
index 8760cf8..e3ea786 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -573,7 +573,7 @@ X-Mailer: git-send-email $gitversion
if ($quiet) {
printf (($dry_run ? "Dry-" : "")."Sent %s\n", $subject);
} else {
- print (($dry_run ? "Dry-" : "")."OK. Log says:\nDate: $date\n");
+ print (($dry_run ? "Dry-" : "")."OK. Log says:\n");
if ($smtp_server !~ m#^/#) {
print "Server: $smtp_server\n";
print "MAIL FROM:<$raw_from>\n";
@@ -581,7 +581,7 @@ X-Mailer: git-send-email $gitversion
} else {
print "Sendmail: $smtp_server ".join(' ',@sendmail_parameters)."\n";
}
- print "From: $sanitized_sender\nSubject: $subject\nCc: $cc\nTo: $to\n\n";
+ print $header, "\n";
if ($smtp) {
print "Result: ", $smtp->code, ' ',
($smtp->message =~ /\n([^\n]+\n)$/s), "\n";
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 83f9470..fc03e40 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -41,4 +41,42 @@ test_expect_success \
'Verify commandline' \
'diff commandline expected'
+cat >expected-show-all-headers <<\EOF
+0001-Second.patch
+(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
+Dry-OK. Log says:
+Server: relay.example.com
+MAIL FROM:<from@example.com>
+RCPT TO:<to@example.com>,<cc@example.com>,<author@example.com>,<bcc@example.com>
+From: Example <from@example.com>
+To: to@example.com
+Cc: cc@example.com, A <author@example.com>
+Subject: [PATCH 1/1] Second.
+Date: Mon, 12 Nov 2007 15:01:19 +0000
+Message-Id: <1194879679-15720-1-git-send-email-from@example.com>
+X-Mailer: git-send-email 1.5.3.5.38.gb33cf-dirty
+In-Reply-To: <unique-message-id@example.com>
+References: <unique-message-id@example.com>
+
+Result: OK
+EOF
+
+replace_header () {
+ EXPECTED=expected-show-all-headers &&
+ ACTUAL=actual-show-all-headers &&
+ REPLACEMENT=`cat ${ACTUAL} | grep "^$1:"` &&
+ if [ ! -z "${REPLACEMENT}" ]; then \
+ cat ${EXPECTED} | sed -e "s/^$1: .*\$/${REPLACEMENT}/" > ${EXPECTED}.$$ && \
+ mv -f ${EXPECTED}.$$ ${EXPECTED}
+ fi
+}
+
+test_expect_success 'Show all headers' '
+ git send-email --dry-run --from="Example <from@example.com>" --to=to@example.com --cc=cc@example.com --bcc=bcc@example.com --in-reply-to="<unique-message-id@example.com>" --smtp-server relay.example.com $patches > actual-show-all-headers &&
+ replace_header "Date" &&
+ replace_header "Message-Id" &&
+ replace_header "X-Mailer" &&
+ diff -u expected-show-all-headers actual-show-all-headers
+'
+
test_done
--
1.5.3.4
^ permalink raw reply related
* Re: [PATCH] status&commit: Teach them to show submodule commit summary
From: Jakub Narebski @ 2007-11-12 16:12 UTC (permalink / raw)
To: git
In-Reply-To: <4738784F.7010106@viscovery.net>
Johannes Sixt wrote:
>> A configuration variable 'submodule.status' is used to turn this summary
>> behaviour on or off (default off). Also --submodule and --no-submodule options
>> are added.
>
> There is already 'status.color', I suggest the configuration to become
> 'status.submoduleSummary'.
Or status.submodule.summary, although we usually use
section.<variable_sub>.key configuration variables,
e.g. branch.<name>.remote. But we have exception:
color.branch.<slot>
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: [PATCH] status&commit: Teach them to show submodule commit summary
From: Johannes Schindelin @ 2007-11-12 16:13 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Ping Yin, Git Mailing List
In-Reply-To: <4738784F.7010106@viscovery.net>
Hi,
On Mon, 12 Nov 2007, Johannes Sixt wrote:
> Ping Yin schrieb:
> > git status/commit just treats submodules as ordinary files when
> > reporting status changes. However, one may also wonder how submodules
> > change (the commits).
> >
> > This commit teaches git status/commit to additionally show commit
> > summary of user-cared (i.e. checked out) modified submodules since
> > HEAD (or HEAD^ if --amend option is on). For submodules deleted or
> > initially added, commit summary are not shown.
>
> In general, I like the idea (as I've already pointed out).
>
> But at this time git-commit is about to be made a builtin, and since
> your implementation contains a lot of non-portable constructs ($'', >&)
> and a new dependency on awk (and, hence, has little chances of being
> accepted), I suggest that you stay tuned, and implement this in the
> forth-coming builtin-commit.c.
I agree.
> > A configuration variable 'submodule.status' is used to turn this
> > summary behaviour on or off (default off). Also --submodule and
> > --no-submodule options are added.
>
> There is already 'status.color', I suggest the configuration to become
> 'status.submoduleSummary'.
You could make this variable even a numeric one. Saying how many lines
you want to have maximally (-1 meaning unlimited).
Ciao,
Dscho
^ permalink raw reply
* Re: Cloning from kernel.org, then switching to another repo
From: Johannes Schindelin @ 2007-11-12 16:16 UTC (permalink / raw)
To: Jon Smirl; +Cc: Git Mailing List
In-Reply-To: <9e4733910711120736g31e3e84cx5a213afc4b889de7@mail.gmail.com>
Hi,
On Mon, 12 Nov 2007, Jon Smirl wrote:
> On 11/12/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>
> > On Mon, 12 Nov 2007, Jon Smirl wrote:
> >
> > > git clone linus
> > > move origin to digispeaker.git
> >
> > AKA "git config remote.origin.url <your-digispeaker-url-here>"
>
> There is more to this:
You must be hiding something.
> jonsmirl@terra:~/foo$ git clone
> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git ds
> clone.....
This sets up branch.master.{remote,merge} to {origin,master}.
> jonsmirl@terra:~/foo/ds$ git config remote.origin.url
> http://git.digispeaker.com/projects/digispeaker-kernel.git
This does not change that setting.
> jonsmirl@terra:~/foo/ds$ git pull
> You asked me to pull without telling me which branch you
> want to merge with, and 'branch.master.merge' in
> your configuration file does not tell me either. Please
> name which branch you want to merge on the command line and
> try again (e.g. 'git pull <repository> <refspec>').
> See git-pull(1) for details on the refspec.
And this does not come up here.
Maybe you don't have a master branch on digispeaker.
Ciao,
Dscho
^ permalink raw reply
* Re: What is the idea for bare repositories?
From: David Kastrup @ 2007-11-12 16:17 UTC (permalink / raw)
To: git
In-Reply-To: <20071112131927.GA1701@c3sl.ufpr.br>
Bruno Cesar Ribas <ribas@c3sl.ufpr.br> writes:
> A bare repository is the way to publish your changes to the public.
> git-daemon and http-clones use a bare repository that only contains
> adminsitrative files.
>
> From man page
> --bare Make a bare GIT repository. That is, instead of creating
> <directory> and placing the administrative files in
> <directory>/.git, make the <directory> itself the $GIT_DIR. This
> obviously implies the -n because there is nowhere to check out
> the working tree. Also the branch heads at the remote are copied
> directly to corresponding local branch heads, without mapping
> them to refs/remotes/origin/. When this option is used, neither
> remote-tracking branches nor the related configuration variables
> are created.
Fine. So why don't the following commands complain? Apart from
git-reset without arguments (which could probably get along without a
working dir), they are supposed to employ a working directory.
> On Mon, Nov 12, 2007 at 02:11:58PM +0100, David Kastrup wrote:
>>
>> I have a repository declared as bare. Some commands treat it as such,
>> other's don't. For example, I get
>>
>> git-diff [no complaint]
>> git-reset [no complaint]
>> git-reset --hard
>> HEAD is now at db862c1... installmanager.sh: setze GIT_WORK_TREE
--
David Kastrup
^ permalink raw reply
* [RFC PATCH] git-svn info: implement info command
From: David D. Kilzer @ 2007-11-12 16:19 UTC (permalink / raw)
To: git; +Cc: David D. Kilzer
Implement "git-svn info" for files and directories based on the "svn info"
command. Note that the -r/--revision argument is not supported yet.
Added 18 tests in t/t9117-git-svn-info.sh.
Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net>
---
Looking for feedback on this patch. Specifically, I'm looking for insight
for the two FIXME comments in the cmd_info() function added to git-svn.
(I can't help but think I'm missing a plumbing command or a basic concept.
Pointers to code, web pages or man pages are welcome.)
Note that I've tried to cover all the bases that "svn info" does (by using
tests), except supporting the -r/--revision argument.
I've also tried to be aggressive in extracting common code into functions.
Dave
Documentation/git-svn.txt | 5 +
git-svn.perl | 194 +++++++++++++++++++++++++++++++------
t/t9117-git-svn-info.sh | 236 +++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 403 insertions(+), 32 deletions(-)
create mode 100644 t/t9117-git-svn-info.sh
diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 488e4b1..c3fc878 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -193,6 +193,11 @@ Any other arguments are passed directly to `git log'
repository (that has been init-ed with git-svn).
The -r<revision> option is required for this.
+'info'::
+ Shows information about a file or directory similar to what
+ `svn info' provides. Does not currently support a -r/--revision
+ argument.
+
--
OPTIONS
diff --git a/git-svn.perl b/git-svn.perl
index dd93e32..256a3e0 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -48,7 +48,8 @@ BEGIN {
foreach (qw/command command_oneline command_noisy command_output_pipe
command_input_pipe command_close_pipe/) {
for my $package ( qw(SVN::Git::Editor SVN::Git::Fetcher
- Git::SVN::Migration Git::SVN::Log Git::SVN),
+ Git::SVN::Migration Git::SVN::Log Git::SVN
+ Git::SVN::Util),
__PACKAGE__) {
*{"${package}::$_"} = \&{"Git::$_"};
}
@@ -177,6 +178,8 @@ my %cmd = (
'file|F=s' => \$_file,
'revision|r=s' => \$_revision,
%cmt_opts } ],
+ 'info' => [ \&cmd_info, "Show info about the latest SVN revision on the current branch",
+ { } ],
);
my $cmd;
@@ -577,6 +580,23 @@ sub cmd_create_ignore {
});
}
+sub canonicalize_path {
+ my ($path) = @_;
+ my $dotSlashAdded = 0;
+ if (substr($path, 0, 1) ne "/") {
+ $path = "./" . $path;
+ $dotSlashAdded = 1;
+ }
+ # File::Spec->canonpath doesn't collapse x/../y into y (for a
+ # good reason), so let's do this manually.
+ $path =~ s#/+#/#g;
+ $path =~ s#/\.(?:/|$)#/#g;
+ $path =~ s#/[^/]+/\.\.##g;
+ $path =~ s#/$##g;
+ $path =~ s#^\./## if $dotSlashAdded;
+ return $path;
+}
+
# get_svnprops(PATH)
# ------------------
# Helper for cmd_propget and cmd_proplist below.
@@ -594,12 +614,7 @@ sub get_svnprops {
# canonicalize the path (otherwise libsvn will abort or fail to
# find the file)
- # File::Spec->canonpath doesn't collapse x/../y into y (for a
- # good reason), so let's do this manually.
- $path =~ s#/+#/#g;
- $path =~ s#/\.(?:/|$)#/#g;
- $path =~ s#/[^/]+/\.\.##g;
- $path =~ s#/$##g;
+ $path = canonicalize_path($path);
my $r = (defined $_revision ? $_revision : $gs->ra->get_latest_revnum);
my $props;
@@ -730,6 +745,96 @@ sub cmd_commit_diff {
}
}
+sub cmd_info {
+ my $path = canonicalize_path(shift or ".");
+ unless (scalar(@_) == 0) {
+ die "Too many arguments specified\n";
+ }
+
+ # FIXME: We use a combination of git-diff, git-ls-files and git-cat-file
+ # to divine the state and type of object that was passed in as $path.
+ # There has to be a better way. Note that only $diffStatus is used
+ # beyond setting $isDirectory below.
+
+ my $diffStatus = (split(' ', command_oneline(qw(diff --cached --name-status --), $path) || ""))[0] || "";
+ my $lsFiles = command_oneline(qw(ls-files), $path) || "";
+ if (!$diffStatus && !$lsFiles) {
+ print STDERR "$path: (Not a versioned resource)\n\n";
+ return;
+ }
+
+ my $catFileType = ($path eq "." || $diffStatus eq "A") ? "" : (command_oneline(qw(cat-file -t), "HEAD:$path") || "");
+ my $isDirectory = (-e $path && ! -f $path && ! -l $path || $diffStatus eq "D" && $catFileType eq "tree");
+
+ my $result = "Path: $path\n";
+ $result .= "Name: " . basename($path) . "\n" if !$isDirectory;
+
+ my ($url, $rev, $uuid, $gs) = working_head_info('HEAD');
+ unless ($gs) {
+ die "Unable to determine upstream SVN information from ",
+ "working tree history\n";
+ }
+ $result .= "URL: " . ($url . ($path eq "." ? "" : "/$path")) . "\n";
+
+ my $repos_root = $gs->ra->{repos_root};
+ Git::SVN::remove_username($repos_root);
+ $result .= "Repository Root: $repos_root\n";
+ $result .= "Repository UUID: $uuid\n" unless $diffStatus eq "A";
+ $result .= "Revision: " . ($diffStatus eq "A" ? 0 : $rev) . "\n";
+
+ $result .= "Node Kind: " . ($isDirectory ? "directory" : "file") . "\n";
+
+ my $schedule = ($diffStatus eq "A" ? "add" : ($diffStatus eq "D" ? "delete" : "normal"));
+ $result .= "Schedule: $schedule\n";
+
+ if ($diffStatus eq "A") {
+ print $result, "\n";
+ return;
+ }
+
+ my ($lc_author, $lc_rev, $lc_date_utc);
+ my @args = Git::SVN::Log::git_svn_log_cmd($rev, $rev, "--", $path);
+ my $log = command_output_pipe(@args);
+ my $esc_color = qr/(?:\033\[(?:(?:\d+;)*\d*)?m)*/;
+ while (<$log>) {
+ if (/^${esc_color}author (.+) <[^>]+> (\d+) ([\-\+]?\d+)$/o) {
+ $lc_author = $1;
+ $lc_date_utc = Git::SVN::Log::parse_git_date($2, $3);
+ } elsif (/^${esc_color} (git-svn-id:.+)$/o) {
+ (undef, $lc_rev, undef) = ::extract_metadata($1);
+ }
+ }
+ close $log;
+
+ Git::SVN::Log::set_local_timezone();
+
+ $result .= "Last Changed Author: $lc_author\n";
+ $result .= "Last Changed Rev: $lc_rev\n";
+ $result .= "Last Changed Date: " . Git::SVN::Log::format_svn_date($lc_date_utc) . "\n";
+
+ if (!$isDirectory) {
+ my $textLastUpdatedDate = ($diffStatus eq "D" ? $lc_date_utc : (stat $path)[9]);
+ $result .= "Text Last Updated: " . Git::SVN::Log::format_svn_date($textLastUpdatedDate) . "\n";
+ my $checksum;
+ # FIXME: We fail to generate the correct checksum for deleted
+ # symlinks here. How do we know if a deleted file was a symlink?
+ if ($diffStatus eq "D") {
+ my ($fh, $ctx) = command_output_pipe(qw(cat-file blob), "HEAD:$path");
+ $checksum = Git::SVN::Util::md5sum($fh);
+ command_close_pipe($fh, $ctx);
+ } elsif (-l $path) {
+ $checksum = Git::SVN::Util::md5sum("link " . command(qw(cat-file blob), "HEAD:$path"));
+ } else {
+ open FILE, "<", $path or die $!;
+ $checksum = Git::SVN::Util::md5sum(\*FILE);
+ close FILE or die $!;
+ }
+ $result .= "Checksum: " . $checksum . "\n";
+ }
+
+ print $result, "\n";
+}
+
########################### utility functions #########################
sub rebase_cmd {
@@ -1037,6 +1142,27 @@ sub linearize_history {
(\@linear_refs, \%parents);
}
+package Git::SVN::Util;
+use strict;
+use warnings;
+use Digest::MD5;
+
+sub md5sum {
+ my $arg = shift;
+ my $ref = ref $arg;
+ my $md5 = Digest::MD5->new();
+ if ($ref eq 'GLOB' || $ref eq 'IO::File') {
+ $md5->addfile($arg) or croak $!;
+ } elsif ($ref eq 'SCALAR') {
+ $md5->add($$arg) or croak $!;
+ } elsif (!$ref) {
+ $md5->add($arg) or croak $!;
+ } else {
+ ::fatal "Can't provide MD5 hash for unknown ref type: '", $ref, "'";
+ }
+ return $md5->hexdigest();
+}
+
package Git::SVN;
use strict;
use warnings;
@@ -2582,7 +2708,6 @@ use strict;
use warnings;
use Carp qw/croak/;
use IO::File qw//;
-use Digest::MD5;
# file baton members: path, mode_a, mode_b, pool, fh, blob, base
sub new {
@@ -2734,9 +2859,7 @@ sub apply_textdelta {
if (defined $exp) {
seek $base, 0, 0 or croak $!;
- my $md5 = Digest::MD5->new;
- $md5->addfile($base);
- my $got = $md5->hexdigest;
+ my $got = Git::SVN::Util::md5sum($base);
die "Checksum mismatch: $fb->{path} $fb->{blob}\n",
"expected: $exp\n",
" got: $got\n" if ($got ne $exp);
@@ -2755,9 +2878,7 @@ sub close_file {
if (my $fh = $fb->{fh}) {
if (defined $exp) {
seek($fh, 0, 0) or croak $!;
- my $md5 = Digest::MD5->new;
- $md5->addfile($fh);
- my $got = $md5->hexdigest;
+ my $got = Git::SVN::Util::md5sum($fh);
if ($got ne $exp) {
die "Checksum mismatch: $path\n",
"expected: $exp\n got: $got\n";
@@ -2809,7 +2930,6 @@ use strict;
use warnings;
use Carp qw/croak/;
use IO::File;
-use Digest::MD5;
sub new {
my ($class, $opts) = @_;
@@ -3113,11 +3233,9 @@ sub chg_file {
$fh->flush == 0 or croak $!;
seek $fh, 0, 0 or croak $!;
- my $md5 = Digest::MD5->new;
- $md5->addfile($fh) or croak $!;
+ my $exp = Git::SVN::Util::md5sum($fh);
seek $fh, 0, 0 or croak $!;
- my $exp = $md5->hexdigest;
my $pool = SVN::Pool->new;
my $atd = $self->apply_textdelta($fbat, undef, $pool);
my $got = SVN::TxDelta::send_stream($fh, @$atd, $pool);
@@ -3810,6 +3928,29 @@ sub run_pager {
exec $pager or ::fatal "Can't run pager: $! ($pager)";
}
+sub format_svn_date {
+ return strftime("%Y-%m-%d %H:%M:%S %z (%a, %d %b %Y)", localtime(shift));
+}
+
+sub parse_git_date {
+ my ($t, $tz) = @_;
+ # Date::Parse isn't in the standard Perl distro :(
+ if ($tz =~ s/^\+//) {
+ $t += tz_to_s_offset($tz);
+ } elsif ($tz =~ s/^\-//) {
+ $t -= tz_to_s_offset($tz);
+ }
+ return $t;
+}
+
+sub set_local_timezone {
+ if (defined $TZ) {
+ $ENV{TZ} = $TZ;
+ } else {
+ delete $ENV{TZ};
+ }
+}
+
sub tz_to_s_offset {
my ($tz) = @_;
$tz =~ s/(\d\d)$//;
@@ -3830,13 +3971,7 @@ sub get_author_info {
$dest->{t} = $t;
$dest->{tz} = $tz;
$dest->{a} = $au;
- # Date::Parse isn't in the standard Perl distro :(
- if ($tz =~ s/^\+//) {
- $t += tz_to_s_offset($tz);
- } elsif ($tz =~ s/^\-//) {
- $t -= tz_to_s_offset($tz);
- }
- $dest->{t_utc} = $t;
+ $dest->{t_utc} = parse_git_date($t, $tz);
}
sub process_commit {
@@ -3890,8 +4025,7 @@ sub show_commit_normal {
my ($c) = @_;
print '-' x72, "\nr$c->{r} | ";
print "$c->{c} | " if $show_commit;
- print "$c->{a} | ", strftime("%Y-%m-%d %H:%M:%S %z (%a, %d %b %Y)",
- localtime($c->{t_utc})), ' | ';
+ print "$c->{a} | ", format_svn_date($c->{t_utc}), ' | ';
my $nr_line = 0;
if (my $l = $c->{l}) {
@@ -3931,11 +4065,7 @@ sub cmd_show_log {
my (@args) = @_;
my ($r_min, $r_max);
my $r_last = -1; # prevent dupes
- if (defined $TZ) {
- $ENV{TZ} = $TZ;
- } else {
- delete $ENV{TZ};
- }
+ set_local_timezone();
if (defined $::_revision) {
if ($::_revision =~ /^(\d+):(\d+)$/) {
($r_min, $r_max) = ($1, $2);
diff --git a/t/t9117-git-svn-info.sh b/t/t9117-git-svn-info.sh
new file mode 100644
index 0000000..b20db04
--- /dev/null
+++ b/t/t9117-git-svn-info.sh
@@ -0,0 +1,236 @@
+#!/bin/sh
+#
+# Copyright (c) 2007 David D. Kilzer
+
+test_description='git-svn info'
+
+. ./lib-git-svn.sh
+
+test_expect_success 'setup repository and import' "
+ rm -rf info gitwc svnwc &&
+ mkdir info &&
+ cd info &&
+ echo one > file &&
+ ln -s file symlink-file &&
+ mkdir directory &&
+ touch directory/.placeholder &&
+ ln -s directory symlink-directory &&
+ svn import -m 'initial' . $svnrepo &&
+ cd .. &&
+ mkdir gitwc &&
+ cd gitwc &&
+ git-svn init $svnrepo &&
+ git-svn fetch &&
+ cd .. &&
+ svn co $svnrepo svnwc &&
+ touch -c -r svnwc/file gitwc/file &&
+ touch -c -r svnwc/directory gitwc/directory &&
+ touch -c -r svnwc/symlink-file gitwc/symlink-file &&
+ touch -c -r svnwc/symlink-directory gitwc/symlink-directory
+ "
+
+test_expect_success 'info no arguments' "
+ (cd svnwc; svn info) > expected.info-no-arguments &&
+ (cd gitwc; git-svn info) > actual.info-no-arguments &&
+ diff -u expected.info-no-arguments actual.info-no-arguments
+ "
+
+test_expect_success 'info dot' "
+ (cd svnwc; svn info .) > expected.info-dot &&
+ (cd gitwc; git-svn info .) > actual.info-dot &&
+ diff -u expected.info-dot actual.info-dot
+ "
+
+test_expect_success 'info file' "
+ (cd svnwc; svn info file) > expected.info-file &&
+ (cd gitwc; git-svn info file) > actual.info-file &&
+ diff -u expected.info-file actual.info-file
+ "
+
+test_expect_success 'info directory' "
+ (cd svnwc; svn info directory) > expected.info-directory &&
+ (cd gitwc; git-svn info directory) > actual.info-directory &&
+ diff -u expected.info-directory actual.info-directory
+ "
+
+test_expect_success 'info symlink-file' "
+ (cd svnwc; svn info symlink-file) > expected.info-symlink-file &&
+ (cd gitwc; git-svn info symlink-file) > actual.info-symlink-file &&
+ diff -u expected.info-symlink-file actual.info-symlink-file
+ "
+
+test_expect_success 'info symlink-directory' "
+ (cd svnwc; svn info symlink-directory) > expected.info-symlink-directory &&
+ (cd gitwc; git-svn info symlink-directory) > actual.info-symlink-directory &&
+ diff -u expected.info-symlink-directory actual.info-symlink-directory
+ "
+
+test_expect_success 'info added-file' "
+ echo two > gitwc/added-file &&
+ cd gitwc &&
+ git add added-file &&
+ cd .. &&
+ cp -p gitwc/added-file svnwc/added-file &&
+ touch -r gitwc/added-file svnwc/added-file &&
+ cd svnwc &&
+ svn add added-file > /dev/null &&
+ cd .. &&
+ (cd svnwc; svn info added-file) > expected.info-added-file &&
+ (cd gitwc; git-svn info added-file) > actual.info-added-file &&
+ diff -u expected.info-added-file actual.info-added-file
+ "
+
+test_expect_success 'info added-directory' "
+ mkdir gitwc/added-directory svnwc/added-directory &&
+ touch -r gitwc/added-directory svnwc/added-directory &&
+ touch gitwc/added-directory/.placeholder &&
+ cd svnwc &&
+ svn add added-directory > /dev/null &&
+ cd .. &&
+ cd gitwc &&
+ git add added-directory &&
+ cd .. &&
+ (cd svnwc; svn info added-directory) > expected.info-added-directory &&
+ (cd gitwc; git-svn info added-directory) > actual.info-added-directory &&
+ diff -u expected.info-added-directory actual.info-added-directory
+ "
+
+test_expect_success 'info added-symlink-file' "
+ cd gitwc &&
+ ln -s added-file added-symlink-file &&
+ git add added-symlink-file &&
+ cd .. &&
+ cd svnwc &&
+ ln -s added-file added-symlink-file &&
+ svn add added-symlink-file > /dev/null &&
+ cd .. &&
+ touch -r gitwc/added-symlink-file svnwc/added-symlink-file &&
+ (cd svnwc; svn info added-symlink-file) > expected.info-added-symlink-file &&
+ (cd gitwc; git-svn info added-symlink-file) > actual.info-added-symlink-file &&
+ diff -u expected.info-added-symlink-file actual.info-added-symlink-file
+ "
+
+test_expect_success 'info added-symlink-directory' "
+ cd gitwc &&
+ ln -s added-directory added-symlink-directory &&
+ git add added-symlink-directory &&
+ cd .. &&
+ cd svnwc &&
+ ln -s added-directory added-symlink-directory &&
+ svn add added-symlink-directory > /dev/null &&
+ cd .. &&
+ touch -r gitwc/added-symlink-directory svnwc/added-symlink-directory &&
+ (cd svnwc; svn info added-symlink-directory) > expected.info-added-symlink-directory &&
+ (cd gitwc; git-svn info added-symlink-directory) > actual.info-added-symlink-directory &&
+ diff -u expected.info-added-symlink-directory actual.info-added-symlink-directory
+ "
+
+replace_Text_Last_Updated_date () {
+ REPLACEMENT=`cat $1 | grep '^Last Changed Date:' | sed -e 's/Last Changed Date/Text Last Updated/'` &&
+ cat $1 | sed -e "s/^Text Last Updated: .*\$/${REPLACEMENT}/" > $1.$$ &&
+ mv -f $1.$$ $1
+}
+
+test_expect_success 'info deleted-file' "
+ cd gitwc &&
+ git rm -f file > /dev/null &&
+ cd .. &&
+ cd svnwc &&
+ svn rm --force file > /dev/null &&
+ cd .. &&
+ (cd svnwc; svn info file) > expected.info-deleted-file &&
+ (cd gitwc; git-svn info file) > actual.info-deleted-file &&
+ replace_Text_Last_Updated_date expected.info-deleted-file &&
+ diff -u expected.info-deleted-file actual.info-deleted-file
+ "
+
+test_expect_success 'info deleted-directory' "
+ cd gitwc &&
+ git rm -r -f directory > /dev/null &&
+ cd .. &&
+ cd svnwc &&
+ svn rm --force directory > /dev/null &&
+ cd .. &&
+ (cd svnwc; svn info directory) > expected.info-deleted-directory &&
+ (cd gitwc; git-svn info directory) > actual.info-deleted-directory &&
+ replace_Text_Last_Updated_date expected.info-deleted-directory &&
+ diff -u expected.info-deleted-directory actual.info-deleted-directory
+ "
+
+test_expect_success 'info deleted-symlink-file' "
+ cd gitwc &&
+ git rm -f symlink-file > /dev/null &&
+ cd .. &&
+ cd svnwc &&
+ svn rm --force symlink-file > /dev/null &&
+ cd .. &&
+ (cd svnwc; svn info symlink-file) > expected.info-deleted-symlink-file &&
+ (cd gitwc; git-svn info symlink-file) > actual.info-deleted-symlink-file &&
+ replace_Text_Last_Updated_date expected.info-deleted-symlink-file &&
+ diff -u expected.info-deleted-symlink-file actual.info-deleted-symlink-file
+ "
+
+test_expect_success 'info deleted-symlink-directory' "
+ cd gitwc &&
+ git rm -f symlink-directory > /dev/null &&
+ cd .. &&
+ cd svnwc &&
+ svn rm --force symlink-directory > /dev/null &&
+ cd .. &&
+ (cd svnwc; svn info symlink-directory) > expected.info-deleted-symlink-directory &&
+ (cd gitwc; git-svn info symlink-directory) > actual.info-deleted-symlink-directory &&
+ replace_Text_Last_Updated_date expected.info-deleted-symlink-directory &&
+ diff -u expected.info-deleted-symlink-directory actual.info-deleted-symlink-directory
+ "
+
+# NOTE: git does not have the concept of replaced objects, so we can't test for them.
+#test_expect_success 'info replaced-file' "/usr/bin/true"
+#test_expect_success 'info replaced-directory' "/usr/bin/true"
+#test_expect_success 'info replaced-symlink-file' "/usr/bin/true"
+#test_expect_success 'info replaced-symlink-directory' "/usr/bin/true"
+
+test_expect_success 'info unknown-file' "
+ echo two > gitwc/unknown-file &&
+ cp -p gitwc/unknown-file svnwc/unknown-file &&
+ touch -r gitwc/unknown-file svnwc/unknown-file &&
+ (cd svnwc; svn info unknown-file) 2> expected.info-unknown-file &&
+ (cd gitwc; git-svn info unknown-file) 2> actual.info-unknown-file &&
+ diff -u expected.info-unknown-file actual.info-unknown-file
+ "
+
+test_expect_success 'info unknown-directory' "
+ mkdir gitwc/unknown-directory svnwc/unknown-directory &&
+ touch -r gitwc/unknown-directory svnwc/unknown-directory &&
+ touch gitwc/unknown-directory/.placeholder &&
+ (cd svnwc; svn info unknown-directory) 2> expected.info-unknown-directory &&
+ (cd gitwc; git-svn info unknown-directory) 2> actual.info-unknown-directory &&
+ diff -u expected.info-unknown-directory actual.info-unknown-directory
+ "
+
+test_expect_success 'info unknown-symlink-file' "
+ cd gitwc &&
+ ln -s unknown-file unknown-symlink-file &&
+ cd .. &&
+ cd svnwc &&
+ ln -s unknown-file unknown-symlink-file &&
+ cd .. &&
+ touch -r gitwc/unknown-symlink-file svnwc/unknown-symlink-file &&
+ (cd svnwc; svn info unknown-symlink-file) 2> expected.info-unknown-symlink-file &&
+ (cd gitwc; git-svn info unknown-symlink-file) 2> actual.info-unknown-symlink-file &&
+ diff -u expected.info-unknown-symlink-file actual.info-unknown-symlink-file
+ "
+
+test_expect_success 'info unknown-symlink-directory' "
+ cd gitwc &&
+ ln -s unknown-directory unknown-symlink-directory &&
+ cd .. &&
+ cd svnwc &&
+ ln -s unknown-directory unknown-symlink-directory &&
+ cd .. &&
+ touch -r gitwc/unknown-symlink-directory svnwc/unknown-symlink-directory &&
+ (cd svnwc; svn info unknown-symlink-directory) 2> expected.info-unknown-symlink-directory &&
+ (cd gitwc; git-svn info unknown-symlink-directory) 2> actual.info-unknown-symlink-directory &&
+ diff -u expected.info-unknown-symlink-directory actual.info-unknown-symlink-directory
+ "
+
+test_done
--
1.5.3.4
^ permalink raw reply related
* Re: What is the idea for bare repositories?
From: Jan Wielemaker @ 2007-11-12 16:19 UTC (permalink / raw)
To: git
In-Reply-To: <Pine.LNX.4.64.0711121355380.4362@racer.site>
On Monday 12 November 2007 14:57, Johannes Schindelin wrote:
> Hi,
>
> On Mon, 12 Nov 2007, Bruno Cesar Ribas wrote:
> > A bare repository is the way to publish your changes to the public.
> > git-daemon and http-clones use a bare repository that only contains
> > adminsitrative files.
>
> More to the point, a bare repository is one which does not have a working
> directory attached.
>
> As such, many commands do not make any sense at all, such as "git add"
> (_what_ do you want to add? There is not even a working directory to work
> with!), or "git commit".
As we are on the subject anyway. Though not tested with the very latest,
but when I was playing with them, I found out that cloning a empty bare
repository produces nothing at all, dispite the promising message:
$ mkdir x && cd x
$ git --bare init --shared=group
Initialized empty shared Git repository in /home/nobackup/jan/tmp/x/
$ cd ..
$ git clone x y
Initialized empty Git repository in /home/jan/nobackup/tmp/y/.git/
$ ls y
ls: cannot access y: No such file or directory
Is this a bug?
--- Jan
^ permalink raw reply
* Re: Cloning from kernel.org, then switching to another repo
From: Jon Smirl @ 2007-11-12 16:22 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Git Mailing List
In-Reply-To: <Pine.LNX.4.64.0711121613570.4362@racer.site>
On 11/12/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> On Mon, 12 Nov 2007, Jon Smirl wrote:
>
> > On 11/12/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> >
> > > On Mon, 12 Nov 2007, Jon Smirl wrote:
> > >
> > > > git clone linus
> > > > move origin to digispeaker.git
> > >
> > > AKA "git config remote.origin.url <your-digispeaker-url-here>"
> >
> > There is more to this:
>
> You must be hiding something.
>
> > jonsmirl@terra:~/foo$ git clone
> > git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git ds
> > clone.....
>
> This sets up branch.master.{remote,merge} to {origin,master}.
>
> > jonsmirl@terra:~/foo/ds$ git config remote.origin.url
> > http://git.digispeaker.com/projects/digispeaker-kernel.git
>
> This does not change that setting.
It edited origin:[remote "origin"]
url = http://git.digispeaker.com/projects/digispeaker-kernel.git
fetch = +refs/heads/*:refs/remotes/origin/*
> > jonsmirl@terra:~/foo/ds$ git pull
> > You asked me to pull without telling me which branch you
> > want to merge with, and 'branch.master.merge' in
> > your configuration file does not tell me either. Please
> > name which branch you want to merge on the command line and
> > try again (e.g. 'git pull <repository> <refspec>').
> > See git-pull(1) for details on the refspec.
>
> And this does not come up here.
>
> Maybe you don't have a master branch on digispeaker.
At digispeaker remote repo:
[daedalus]$ git branch
m24
m25
m26
m28
m29
* master
[daedalus]$
gitweb is at:
git.digispeaker.com
[daedalus]$ cd refs
[daedalus]$ find
.
./heads
./heads/m24
./heads/m25
./heads/m26
./heads/m28
./heads/m29
./heads/master
./tags
[daedalus]$
>
> Ciao,
> Dscho
>
>
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply
* Cloning empty repositories, was Re: What is the idea for bare repositories?
From: Johannes Schindelin @ 2007-11-12 16:34 UTC (permalink / raw)
To: Jan Wielemaker; +Cc: git
In-Reply-To: <200711121719.54146.wielemak@science.uva.nl>
Hi,
On Mon, 12 Nov 2007, Jan Wielemaker wrote:
> I found out that cloning a empty bare repository produces nothing at
> all, [...]
If they are empty, what exactly do you mean to clone?
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH] status&commit: Teach them to show submodule commit summary
From: Ping Yin @ 2007-11-12 16:35 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Git Mailing List
In-Reply-To: <4738784F.7010106@viscovery.net>
On Nov 12, 2007 11:59 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:
> But at this time git-commit is about to be made a builtin, and since your
> implementation contains a lot of non-portable constructs ($'', >&) and a new
> dependency on awk (and, hence, has little chances of being accepted), I
> suggest that you stay tuned, and implement this in the forth-coming
> builtin-commit.c.
Implement this in shell scripts is just a piece of cake, but not so
easy in builtin-commit.c. Not to mention that i'm unamiliar with git c
code. $', >& portable problem can be easily corrected. However, awk is
a new dependency? I have seen it in git-mergetool.sh
>
> > A configuration variable 'submodule.status' is used to turn this summary
> > behaviour on or off (default off). Also --submodule and --no-submodule options
> > are added.
>
> There is already 'status.color', I suggest the configuration to become
> 'status.submoduleSummary'.
There is 'status.color', but 'color.status' is prefered as said in the
documentation. So i follows this rule, name the variable submodule.*
just as the ones for git-submodule. I think it's a good idea to put
all submodule related configuration variables in the submodule.*
namespaces.
>
> -- Hannes
>
>
--
Ping Yin
^ permalink raw reply
* Re: Cloning from kernel.org, then switching to another repo
From: Johannes Schindelin @ 2007-11-12 16:36 UTC (permalink / raw)
To: Jon Smirl; +Cc: Git Mailing List
In-Reply-To: <9e4733910711120822x18019fe6v40eb8ee0e48282dd@mail.gmail.com>
Hi,
On Mon, 12 Nov 2007, Jon Smirl wrote:
> On 11/12/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>
> > On Mon, 12 Nov 2007, Jon Smirl wrote:
> >
> > > jonsmirl@terra:~/foo$ git clone
> > > git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git ds
> > > clone.....
> >
> > This sets up branch.master.{remote,merge} to {origin,master}.
You haven't shown me that this is set correctly in your set up, and if it
is, when it stops being correctly set up.
Ciao,
Dscho
^ 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