* Re: Is there any plan to support partial checkout or submoudule improvement?
From: Lars Hjemli @ 2007-10-16 10:50 UTC (permalink / raw)
To: franky; +Cc: git
In-Reply-To: <20071016095622.CE14F7E6F@mail.kooxoo.com>
On 10/16/07, franky <yinping@kooxoo.com> wrote:
> lars said:
> > $ git archive --remote=<repo> <revspec> <path> | tar -x
>
> I can't know deployment version easily
The <revspec> can be a tag. So you can easily create a wrapper script
to allow such things as
$ ./deploy.sh v1.2.3
$ ./deploy.sh HEAD
$ ./deploy.sh master
$ ./deploy.sh <sha1>
(note: for this to work with the git:// protocol, git-daemon needs
--enable=upload-archive)
--
larsh
^ permalink raw reply
* cogito and remote#branch, was Re: [PATCH] Git homepage: remove all the references to Cogito
From: Johannes Schindelin @ 2007-10-16 10:49 UTC (permalink / raw)
To: Petr Baudis; +Cc: Paolo Ciarrocchi, git
In-Reply-To: <20071016021933.GH12156@machine.or.cz>
Hi,
On Tue, 16 Oct 2007, Petr Baudis wrote:
> On Mon, Oct 15, 2007 at 11:38:00PM +0200, Paolo Ciarrocchi wrote:
> > @@ -286,15 +285,6 @@ a gitweb interface, at <a href="http://repo.or.cz/">http://repo.or.cz/</a>.</p>
> >
> > <dl>
> >
> > -<dt id="cogito">Cogito</dt>
> > -<dd>
> > -<a href="http://git.or.cz/cogito/">Cogito</a>
> > -is a popular version control system on top of Git.
> > -It aims at seamless user interface and ease of use, providing
> > -generally smoother user experience than the "raw" Git interface
> > -and indeed also many other version control systems. However, it
> > -also lacks many advanced capabilities of Git and is currently
> > -being slowly phased out.</dd>
> >
> > <dt id="stgit">StGIT</dt>
> > <dd><a href="http://www.procode.org/stgit/">Stacked Git</a> provides
>
> I'm not sure this is good idea, Cogito is still quite frequently used
> and it should be documented that it exists.
I agree. But maybe it could be marked as unmaintained? Maybe someone
steps up to maintain it. Or, even better, comes up with a list of "this
is what I like do regularly with cogito, but there's no easy way with core
git" issues.
In related news, I recently thought about the url#branch issue.
There were three arguments against it AFAIR: "#" is a comment marker, and
this syntax is not extensible to more than one branch names. And that the
branch name is not really a part of the URL.
Turns out that I am not so sure about the last two issues.
It is easily extensible to more than one branch by remote#branch1#branch2,
and in a very real sense, this is a resource locator.
And we could replace the "#" by every character that is illegal in ref
names as well as URLs. I propose SPC. ('#' is allowed in refnames.)
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH] rev-list documentation: add "--bisect-all".
From: Ralf Wildenhues @ 2007-10-16 10:42 UTC (permalink / raw)
To: Christian Couder
Cc: Junio Hamano, Johannes Schindelin, Frank Lichtenheld, git
In-Reply-To: <20071016055905.55c1d280.chriscool@tuxfamily.org>
Hello,
A couple of typos:
* Christian Couder wrote on Tue, Oct 16, 2007 at 05:59:05AM CEST:
>
> diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt
> index 7cd0e89..f6dd0c4 100644
> --- a/Documentation/git-rev-list.txt
> +++ b/Documentation/git-rev-list.txt
[...]
> @@ -354,6 +355,21 @@ the expected number of commits to be tested if `bisect_rev`
> turns out to be bad to `bisect_bad`, and the number of commits
> we are bisecting right now to `bisect_all`.
>
> +--bisect-all::
> +
> +This outputs all the commit objects between the included and excluded
> +commits, ordered by their distance to the included and excluded
> +commits. The farthest from them is displayed first. (This is the only
> +one displayed by `--bisect`.)
> +
> +This is usefull because it makes it easy to choose a good commit to
s/usefull/useful/
> +test when you want to avoid to test some of them for some reason (they
> +may not compile for example).
> +
> +This option can be used along with `--bisect-vars`, in this case,
> +after all the sorted commit objects, there will be the same text as if
> +`--bisect-vars` has been used alone.
s/has/had/
Cheers,
Ralf
^ permalink raw reply
* Re: On Tabs and Spaces
From: Adam Piatyszek @ 2007-10-16 10:16 UTC (permalink / raw)
To: Lars Hjemli; +Cc: Michael Witten, git
In-Reply-To: <8c5c35580710160204s5a4f9fb3j68c0a86c4d080cb7@mail.gmail.com>
* Lars Hjemli [16 X 2007 11:04]:
>>From http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/CodingStyle;h=7f1730f1a1ae2e9a6f368bdb10ff65f4568863d5;hb=HEAD
>
> (defun linux-c-mode ()
> "C mode with adjusted defaults for use with the Linux kernel."
> (interactive)
> (c-mode)
> (c-set-style "K&R")
> (setq tab-width 8)
> (setq indent-tabs-mode t)
> (setq c-basic-offset 8))
>
>
> And to use this only in a specific directory:
>
> (setq auto-mode-alist (cons '("/usr/src/linux.*/.*\\.[ch]$" . linux-c-mode)
> auto-mode-alist))
Thanks!
But it seems that the above settings are still imperfect, since they
mixes tabs and spaces when aligning. For instance:
int some_function(int some_variable)
{
<T> int result;
<T> result = execute_another_function(some_variable,
<T> <T> <T> <T> <T> ..other_variable);
<T> return result;
}
<T> - represents tab here, `.' - space
And if one change the tab size, it will result in a messy alignment in
line 5.
I guess there is no ideal solution for this in Emacs.
BR,
/Adam
--
.:. Adam Piatyszek - "ediap" .:. JID: ediap(at)jabber.org .:.
.:. ediap(at)users.sourceforge.net .:. PGP key ID: 0x1F115CCB .:.
^ permalink raw reply
* git-svn has a _lot_ of metadata
From: Karl Hasselström @ 2007-10-16 10:22 UTC (permalink / raw)
To: Eric Wong; +Cc: git list
I just imported an svn repository with about 120 tags and 140
branches, and with some repacking got the pack file down to a
comfortable 80 MB. However, .git is over 600 MB, owing to about 520 MB
of git-svn metadata. (This wasn't a problem when I only tracked a
handful of branches, since they're only a few megs apiece.)
There appears to be two kinds of metadata that takes up a significant
fraction of the space.
* An index file is saved for each branch and tag. I presume this
corresponds to the branch head, and is used to speed up importing
of new revisions to that branch. However, recreating an index with
git-read-tree is very fast, so I don't think these need to be
saved between git-svn runs.
* A "rev_db" file is saved for each branch and tag. This is a text
file with one sha1 per line -- I seem to remember that line X of
this file is the commit sha1 of svn revision X. For revisions that
didn't touch this branch/tag, there's a line of 40 zeros. And
since every revision touches just one branch, it's almost all
zeros unless the number of branches is very small.
This could probably be stored _much_ more efficiently. Just
gzipping it with the standard options shrinks it by between a
factor of 4 (for one of the busiest branches) and 300 (for a tag,
which is written just once). But I understand that we need quick
random access here?
The index files should be easy enough to erase between runs, if they
indeed just correspond to the branch head. The rev_db files are
trickier; exactly what kind of lookups are required? Could it perhaps
be done with just one file, instead of one per branch/tag?
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle
^ permalink raw reply
* Re: Switching from CVS to GIT
From: Nguyen Thai Ngoc Duy @ 2007-10-16 10:09 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: prohaska, git, raa.lkml, ae, tsuna, Johannes.Schindelin
In-Reply-To: <uprzfithw.fsf@gnu.org>
On 10/16/07, Eli Zaretskii <eliz@gnu.org> wrote:
> > Date: Tue, 16 Oct 2007 09:24:50 +0700
> > From: "Nguyen Thai Ngoc Duy" <pclouds@gmail.com>
> > Cc: "Git Mailing List" <git@vger.kernel.org>, "Alex Riesen" <raa.lkml@gmail.com>,
> > "Eli Zaretskii" <eliz@gnu.org>, "Andreas Ericsson" <ae@op5.se>,
> > tsuna@lrde.epita.fr,
> > "Johannes Schindelin" <Johannes.Schindelin@gmx.de>
> >
> > I did try hard to find the legendary
> > zsh for Windows before giving up and porting busybox's ash instead.
>
> Where can one find this port of busybox's ash?
>
http://repo.or.cz/w/git/pclouds.git?a=shortlog;h=gitbox
In directory box/shell.
--
Duy
^ permalink raw reply
* [PATCH 3/3] git-cvsexportcommit.perl: git-apply no longer needs --binary
From: Michael Witten @ 2007-10-16 8:08 UTC (permalink / raw)
To: git; +Cc: Michael Witten
In-Reply-To: <1192522094-4988-2-git-send-email-mfwitten@mit.edu>
Signed-off-by: Michael Witten <mfwitten@mit.edu>
---
git-cvsexportcommit.perl | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index 869c8b5..22c3d2f 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -129,7 +129,7 @@ my $context = $opt_p ? '' : '-C1';
print "Checking if patch will apply\n";
my @stat;
-open APPLY, "GIT_DIR= git-apply $context --binary --summary --numstat<.cvsexportcommit.diff|" || die "cannot patch";
+open APPLY, "GIT_DIR= git-apply $context --summary --numstat<.cvsexportcommit.diff|" || die "cannot patch";
@stat=<APPLY>;
close APPLY || die "Cannot patch";
my (@bfiles,@files,@afiles,@dfiles);
@@ -215,7 +215,7 @@ if ($dirty) {
}
print "Applying\n";
-`GIT_DIR= git-apply $context --binary --summary --numstat --apply <.cvsexportcommit.diff` || die "cannot patch";
+`GIT_DIR= git-apply $context --summary --numstat --apply <.cvsexportcommit.diff` || die "cannot patch";
print "Patch applied successfully. Adding new files and directories to CVS\n";
my $dirtypatch = 0;
--
1.5.3.4.207.g6d7480-dirty
^ permalink raw reply related
* [PATCH 1/3] git-cvsexportcommit.perl tabified
From: Michael Witten @ 2007-10-16 8:08 UTC (permalink / raw)
To: git; +Cc: Michael Witten
Signed-off-by: Michael Witten <mfwitten@mit.edu>
---
This patch attempts to tabify this code.
Please be gentle, this is my second time
submitting a patch.
git-cvsexportcommit.perl | 284 +++++++++++++++++++++++-----------------------
1 files changed, 141 insertions(+), 143 deletions(-)
diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index a33fa8d..b330c3d 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -12,7 +12,7 @@ use Data::Dumper;
use File::Basename qw(basename dirname);
unless ($ENV{GIT_DIR} && -r $ENV{GIT_DIR}){
- die "GIT_DIR is not defined or is unreadable";
+ die "GIT_DIR is not defined or is unreadable";
}
our ($opt_h, $opt_P, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m, $opt_d, $opt_u);
@@ -25,15 +25,13 @@ die "Need at least one commit identifier!" unless @ARGV;
my @cvs;
if ($opt_d) {
- @cvs = ('cvs', '-d', $opt_d);
+ @cvs = ('cvs', '-d', $opt_d);
} else {
- @cvs = ('cvs');
+ @cvs = ('cvs');
}
# setup a tempdir
-our ($tmpdir, $tmpdirname) = tempdir('git-cvsapplycommit-XXXXXX',
- TMPDIR => 1,
- CLEANUP => 1);
+our ($tmpdir, $tmpdirname) = tempdir('git-cvsapplycommit-XXXXXX', TMPDIR => 1, CLEANUP => 1);
# resolve target commit
my $commit;
@@ -41,18 +39,18 @@ $commit = pop @ARGV;
$commit = safe_pipe_capture('git-rev-parse', '--verify', "$commit^0");
chomp $commit;
if ($?) {
- die "The commit reference $commit did not resolve!";
+ die "The commit reference $commit did not resolve!";
}
# resolve what parent we want
my $parent;
if (@ARGV) {
- $parent = pop @ARGV;
- $parent = safe_pipe_capture('git-rev-parse', '--verify', "$parent^0");
- chomp $parent;
- if ($?) {
- die "The parent reference did not resolve!";
- }
+ $parent = pop @ARGV;
+ $parent = safe_pipe_capture('git-rev-parse', '--verify', "$parent^0");
+ chomp $parent;
+ if ($?) {
+ die "The parent reference did not resolve!";
+ }
}
# find parents from the commit itself
@@ -65,44 +63,44 @@ my $title;
my $msg = '';
foreach my $line (@commit) {
- chomp $line;
- if ($stage eq 'headers' && $line eq '') {
- $stage = 'msg';
- next;
- }
-
- if ($stage eq 'headers') {
- if ($line =~ m/^parent (\w{40})$/) { # found a parent
- push @parents, $1;
- } elsif ($line =~ m/^author (.+) \d+ [-+]\d+$/) {
- $author = $1;
- } elsif ($line =~ m/^committer (.+) \d+ [-+]\d+$/) {
- $committer = $1;
+ chomp $line;
+ if ($stage eq 'headers' && $line eq '') {
+ $stage = 'msg';
+ next;
}
- } else {
- $msg .= $line . "\n";
- unless ($title) {
- $title = $line;
+
+ if ($stage eq 'headers') {
+ if ($line =~ m/^parent (\w{40})$/) { # found a parent
+ push @parents, $1;
+ } elsif ($line =~ m/^author (.+) \d+ [-+]\d+$/) {
+ $author = $1;
+ } elsif ($line =~ m/^committer (.+) \d+ [-+]\d+$/) {
+ $committer = $1;
+ }
+ } else {
+ $msg .= $line . "\n";
+ unless ($title) {
+ $title = $line;
+ }
}
- }
}
if ($parent) {
- my $found;
- # double check that it's a valid parent
- foreach my $p (@parents) {
- if ($p eq $parent) {
- $found = 1;
- last;
- }; # found it
- }
- die "Did not find $parent in the parents for this commit!" if !$found and !$opt_P;
+ my $found;
+ # double check that it's a valid parent
+ foreach my $p (@parents) {
+ if ($p eq $parent) {
+ $found = 1;
+ last;
+ }; # found it
+ }
+ die "Did not find $parent in the parents for this commit!" if !$found and !$opt_P;
} else { # we don't have a parent from the cmdline...
- if (@parents == 1) { # it's safe to get it from the commit
- $parent = $parents[0];
- } else { # or perhaps not!
- die "This commit has more than one parent -- please name the parent you want to use explicitly";
- }
+ if (@parents == 1) { # it's safe to get it from the commit
+ $parent = $parents[0];
+ } else { # or perhaps not!
+ die "This commit has more than one parent -- please name the parent you want to use explicitly";
+ }
}
$opt_v && print "Applying to CVS commit $commit from parent $parent\n";
@@ -110,14 +108,14 @@ $opt_v && print "Applying to CVS commit $commit from parent $parent\n";
# grab the commit message
open(MSG, ">.msg") or die "Cannot open .msg for writing";
if ($opt_m) {
- print MSG $opt_m;
+ print MSG $opt_m;
}
print MSG $msg;
if ($opt_a) {
- print MSG "\n\nAuthor: $author\n";
- if ($author ne $committer) {
- print MSG "Committer: $committer\n";
- }
+ print MSG "\n\nAuthor: $author\n";
+ if ($author ne $committer) {
+ print MSG "Committer: $committer\n";
+ }
}
close MSG;
@@ -153,70 +151,70 @@ map { s/\\([0-7]{3})/sprintf('%c',oct $1)/eg } @bfiles,@files;
my $dirty;
my @dirs;
foreach my $p (@afiles) {
- my $path = dirname $p;
- while (!-d $path and ! grep { $_ eq $path } @dirs) {
- unshift @dirs, $path;
- $path = dirname $path;
- }
+ my $path = dirname $p;
+ while (!-d $path and ! grep { $_ eq $path } @dirs) {
+ unshift @dirs, $path;
+ $path = dirname $path;
+ }
}
# ... check dirs,
foreach my $d (@dirs) {
- if (-e $d) {
- $dirty = 1;
- warn "$d exists and is not a directory!\n";
- }
+ if (-e $d) {
+ $dirty = 1;
+ warn "$d exists and is not a directory!\n";
+ }
}
# ... query status of all files that we have a directory for and parse output of 'cvs status' to %cvsstat.
my @canstatusfiles;
foreach my $f (@files) {
- my $path = dirname $f;
- next if (grep { $_ eq $path } @dirs);
- push @canstatusfiles, $f;
+ my $path = dirname $f;
+ next if (grep { $_ eq $path } @dirs);
+ push @canstatusfiles, $f;
}
my %cvsstat;
if (@canstatusfiles) {
- if ($opt_u) {
- my @updated = safe_pipe_capture(@cvs, 'update', @canstatusfiles);
- print @updated;
- }
- my @cvsoutput;
- @cvsoutput= safe_pipe_capture(@cvs, 'status', @canstatusfiles);
- my $matchcount = 0;
- foreach my $l (@cvsoutput) {
- chomp $l;
- if ( $l =~ /^File:/ and $l =~ /Status: (.*)$/ ) {
- $cvsstat{$canstatusfiles[$matchcount]} = $1;
- $matchcount++;
- }
- }
+ if ($opt_u) {
+ my @updated = safe_pipe_capture(@cvs, 'update', @canstatusfiles);
+ print @updated;
+ }
+ my @cvsoutput;
+ @cvsoutput= safe_pipe_capture(@cvs, 'status', @canstatusfiles);
+ my $matchcount = 0;
+ foreach my $l (@cvsoutput) {
+ chomp $l;
+ if ( $l =~ /^File:/ and $l =~ /Status: (.*)$/ ) {
+ $cvsstat{$canstatusfiles[$matchcount]} = $1;
+ $matchcount++;
+ }
+ }
}
# ... validate new files,
foreach my $f (@afiles) {
- if (defined ($cvsstat{$f}) and $cvsstat{$f} ne "Unknown") {
- $dirty = 1;
- warn "File $f is already known in your CVS checkout -- perhaps it has been added by another user. Or this may indicate that it exists on a different branch. If this is the case, use -f to force the merge.\n";
- warn "Status was: $cvsstat{$f}\n";
- }
+ if (defined ($cvsstat{$f}) and $cvsstat{$f} ne "Unknown") {
+ $dirty = 1;
+ warn "File $f is already known in your CVS checkout -- perhaps it has been added by another user. Or this may indicate that it exists on a different branch. If this is the case, use -f to force the merge.\n";
+ warn "Status was: $cvsstat{$f}\n";
+ }
}
# ... validate known files.
foreach my $f (@files) {
- next if grep { $_ eq $f } @afiles;
- # TODO:we need to handle removed in cvs
- unless (defined ($cvsstat{$f}) and $cvsstat{$f} eq "Up-to-date") {
- $dirty = 1;
- warn "File $f not up to date but has status '$cvsstat{$f}' in your CVS checkout!\n";
- }
+ next if grep { $_ eq $f } @afiles;
+ # TODO:we need to handle removed in cvs
+ unless (defined ($cvsstat{$f}) and $cvsstat{$f} eq "Up-to-date") {
+ $dirty = 1;
+ warn "File $f not up to date but has status '$cvsstat{$f}' in your CVS checkout!\n";
+ }
}
if ($dirty) {
- if ($opt_f) { warn "The tree is not clean -- forced merge\n";
- $dirty = 0;
- } else {
- die "Exiting: your CVS tree is not clean for this merge.";
- }
+ if ($opt_f) { warn "The tree is not clean -- forced merge\n";
+ $dirty = 0;
+ } else {
+ die "Exiting: your CVS tree is not clean for this merge.";
+ }
}
print "Applying\n";
@@ -225,30 +223,30 @@ print "Applying\n";
print "Patch applied successfully. Adding new files and directories to CVS\n";
my $dirtypatch = 0;
foreach my $d (@dirs) {
- if (system(@cvs,'add',$d)) {
- $dirtypatch = 1;
- warn "Failed to cvs add directory $d -- you may need to do it manually";
- }
+ if (system(@cvs,'add',$d)) {
+ $dirtypatch = 1;
+ warn "Failed to cvs add directory $d -- you may need to do it manually";
+ }
}
foreach my $f (@afiles) {
- if (grep { $_ eq $f } @bfiles) {
- system(@cvs, 'add','-kb',$f);
- } else {
- system(@cvs, 'add', $f);
- }
- if ($?) {
- $dirtypatch = 1;
- warn "Failed to cvs add $f -- you may need to do it manually";
- }
+ if (grep { $_ eq $f } @bfiles) {
+ system(@cvs, 'add','-kb',$f);
+ } else {
+ system(@cvs, 'add', $f);
+ }
+ if ($?) {
+ $dirtypatch = 1;
+ warn "Failed to cvs add $f -- you may need to do it manually";
+ }
}
foreach my $f (@dfiles) {
- system(@cvs, 'rm', '-f', $f);
- if ($?) {
- $dirtypatch = 1;
- warn "Failed to cvs rm -f $f -- you may need to do it manually";
- }
+ system(@cvs, 'rm', '-f', $f);
+ if ($?) {
+ $dirtypatch = 1;
+ warn "Failed to cvs rm -f $f -- you may need to do it manually";
+ }
}
print "Commit to CVS\n";
@@ -257,25 +255,25 @@ my @commitfiles = map { unless (m/\s/) { '\''.$_.'\''; } else { $_; }; } (@files
my $cmd = join(' ', @cvs)." commit -F .msg @commitfiles";
if ($dirtypatch) {
- print "NOTE: One or more hunks failed to apply cleanly.\n";
- print "You'll need to apply the patch in .cvsexportcommit.diff manually\n";
- print "using a patch program. After applying the patch and resolving the\n";
- print "problems you may commit using:";
- print "\n $cmd\n\n";
- exit(1);
+ print "NOTE: One or more hunks failed to apply cleanly.\n";
+ print "You'll need to apply the patch in .cvsexportcommit.diff manually\n";
+ print "using a patch program. After applying the patch and resolving the\n";
+ print "problems you may commit using:";
+ print "\n $cmd\n\n";
+ exit(1);
}
if ($opt_c) {
- print "Autocommit\n $cmd\n";
- print safe_pipe_capture(@cvs, 'commit', '-F', '.msg', @files);
- if ($?) {
- die "Exiting: The commit did not succeed";
- }
- print "Committed successfully to CVS\n";
- # clean up
- unlink(".msg");
+ print "Autocommit\n $cmd\n";
+ print safe_pipe_capture(@cvs, 'commit', '-F', '.msg', @files);
+ if ($?) {
+ die "Exiting: The commit did not succeed";
+ }
+ print "Committed successfully to CVS\n";
+ # clean up
+ unlink(".msg");
} else {
- print "Ready for you to commit, just run:\n\n $cmd\n";
+ print "Ready for you to commit, just run:\n\n $cmd\n";
}
# clean up
@@ -297,25 +295,25 @@ END
# to work around shell problems with weird characters in arguments
# if the exec returns non-zero we die
sub safe_pipe_capture {
- my @output;
- if (my $pid = open my $child, '-|') {
- @output = (<$child>);
- close $child or die join(' ',@_).": $! $?";
- } else {
- exec(@_) or die "$! $?"; # exec() can fail the executable can't be found
- }
- return wantarray ? @output : join('',@output);
+ my @output;
+ if (my $pid = open my $child, '-|') {
+ @output = (<$child>);
+ close $child or die join(' ',@_).": $! $?";
+ } else {
+ exec(@_) or die "$! $?"; # exec() can fail the executable can't be found
+ }
+ return wantarray ? @output : join('',@output);
}
sub safe_pipe_capture_blob {
- my $output;
- if (my $pid = open my $child, '-|') {
- local $/;
- undef $/;
- $output = (<$child>);
- close $child or die join(' ',@_).": $! $?";
- } else {
- exec(@_) or die "$! $?"; # exec() can fail the executable can't be found
- }
- return $output;
+ my $output;
+ if (my $pid = open my $child, '-|') {
+ local $/;
+ undef $/;
+ $output = (<$child>);
+ close $child or die join(' ',@_).": $! $?";
+ } else {
+ exec(@_) or die "$! $?"; # exec() can fail the executable can't be found
+ }
+ return $output;
}
--
1.5.3.4.207.g6d7480-dirty
^ permalink raw reply related
* [PATCH] git-cvsexportcommit.perl tabified
From: Michael Witten @ 2007-10-16 9:56 UTC (permalink / raw)
To: git; +Cc: spearce, Michael Witten
---
This patch can be applied to spearce/next
The other patch for removing --binary should
still be applicable.
git-cvsexportcommit.perl | 277 +++++++++++++++++++++++-----------------------
1 files changed, 139 insertions(+), 138 deletions(-)
diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index 6b0123c..9dac7aa 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -12,7 +12,7 @@ use Data::Dumper;
use File::Basename qw(basename dirname);
unless ($ENV{GIT_DIR} && -r $ENV{GIT_DIR}){
- die "GIT_DIR is not defined or is unreadable";
+ die "GIT_DIR is not defined or is unreadable";
}
our ($opt_h, $opt_P, $opt_p, $opt_v, $opt_c, $opt_f, $opt_a, $opt_m, $opt_d, $opt_u);
@@ -36,18 +36,18 @@ $commit = pop @ARGV;
$commit = safe_pipe_capture('git-rev-parse', '--verify', "$commit^0");
chomp $commit;
if ($?) {
- die "The commit reference $commit did not resolve!";
+ die "The commit reference $commit did not resolve!";
}
# resolve what parent we want
my $parent;
if (@ARGV) {
- $parent = pop @ARGV;
- $parent = safe_pipe_capture('git-rev-parse', '--verify', "$parent^0");
- chomp $parent;
- if ($?) {
- die "The parent reference did not resolve!";
- }
+ $parent = pop @ARGV;
+ $parent = safe_pipe_capture('git-rev-parse', '--verify', "$parent^0");
+ chomp $parent;
+ if ($?) {
+ die "The parent reference did not resolve!";
+ }
}
# find parents from the commit itself
@@ -60,44 +60,44 @@ my $title;
my $msg = '';
foreach my $line (@commit) {
- chomp $line;
- if ($stage eq 'headers' && $line eq '') {
- $stage = 'msg';
- next;
- }
-
- if ($stage eq 'headers') {
- if ($line =~ m/^parent (\w{40})$/) { # found a parent
- push @parents, $1;
- } elsif ($line =~ m/^author (.+) \d+ [-+]\d+$/) {
- $author = $1;
- } elsif ($line =~ m/^committer (.+) \d+ [-+]\d+$/) {
- $committer = $1;
+ chomp $line;
+ if ($stage eq 'headers' && $line eq '') {
+ $stage = 'msg';
+ next;
}
- } else {
- $msg .= $line . "\n";
- unless ($title) {
- $title = $line;
+
+ if ($stage eq 'headers') {
+ if ($line =~ m/^parent (\w{40})$/) { # found a parent
+ push @parents, $1;
+ } elsif ($line =~ m/^author (.+) \d+ [-+]\d+$/) {
+ $author = $1;
+ } elsif ($line =~ m/^committer (.+) \d+ [-+]\d+$/) {
+ $committer = $1;
+ }
+ } else {
+ $msg .= $line . "\n";
+ unless ($title) {
+ $title = $line;
+ }
}
- }
}
if ($parent) {
- my $found;
- # double check that it's a valid parent
- foreach my $p (@parents) {
- if ($p eq $parent) {
- $found = 1;
- last;
- }; # found it
- }
- die "Did not find $parent in the parents for this commit!" if !$found and !$opt_P;
+ my $found;
+ # double check that it's a valid parent
+ foreach my $p (@parents) {
+ if ($p eq $parent) {
+ $found = 1;
+ last;
+ }; # found it
+ }
+ die "Did not find $parent in the parents for this commit!" if !$found and !$opt_P;
} else { # we don't have a parent from the cmdline...
- if (@parents == 1) { # it's safe to get it from the commit
- $parent = $parents[0];
- } else { # or perhaps not!
- die "This commit has more than one parent -- please name the parent you want to use explicitly";
- }
+ if (@parents == 1) { # it's safe to get it from the commit
+ $parent = $parents[0];
+ } else { # or perhaps not!
+ die "This commit has more than one parent -- please name the parent you want to use explicitly";
+ }
}
$opt_v && print "Applying to CVS commit $commit from parent $parent\n";
@@ -105,14 +105,14 @@ $opt_v && print "Applying to CVS commit $commit from parent $parent\n";
# grab the commit message
open(MSG, ">.msg") or die "Cannot open .msg for writing";
if ($opt_m) {
- print MSG $opt_m;
+ print MSG $opt_m;
}
print MSG $msg;
if ($opt_a) {
- print MSG "\n\nAuthor: $author\n";
- if ($author ne $committer) {
- print MSG "Committer: $committer\n";
- }
+ print MSG "\n\nAuthor: $author\n";
+ if ($author ne $committer) {
+ print MSG "Committer: $committer\n";
+ }
}
close MSG;
@@ -148,70 +148,71 @@ map { s/\\([0-7]{3})/sprintf('%c',oct $1)/eg } @bfiles,@files;
my $dirty;
my @dirs;
foreach my $p (@afiles) {
- my $path = dirname $p;
- while (!-d $path and ! grep { $_ eq $path } @dirs) {
- unshift @dirs, $path;
- $path = dirname $path;
- }
+ my $path = dirname $p;
+ while (!-d $path and ! grep { $_ eq $path } @dirs) {
+ unshift @dirs, $path;
+ $path = dirname $path;
+ }
}
# ... check dirs,
foreach my $d (@dirs) {
- if (-e $d) {
- $dirty = 1;
- warn "$d exists and is not a directory!\n";
- }
+ if (-e $d) {
+ $dirty = 1;
+ warn "$d exists and is not a directory!\n";
+ }
}
# ... query status of all files that we have a directory for and parse output of 'cvs status' to %cvsstat.
my @canstatusfiles;
foreach my $f (@files) {
- my $path = dirname $f;
- next if (grep { $_ eq $path } @dirs);
- push @canstatusfiles, $f;
+ my $path = dirname $f;
+ next if (grep { $_ eq $path } @dirs);
+ push @canstatusfiles, $f;
}
my %cvsstat;
if (@canstatusfiles) {
- if ($opt_u) {
- my @updated = safe_pipe_capture(@cvs, 'update', @canstatusfiles);
- print @updated;
- }
- my @cvsoutput;
- @cvsoutput= safe_pipe_capture(@cvs, 'status', @canstatusfiles);
- my $matchcount = 0;
- foreach my $l (@cvsoutput) {
- chomp $l;
- if ( $l =~ /^File:/ and $l =~ /Status: (.*)$/ ) {
- $cvsstat{$canstatusfiles[$matchcount]} = $1;
- $matchcount++;
- }
- }
+ if ($opt_u) {
+ my @updated = safe_pipe_capture(@cvs, 'update', @canstatusfiles);
+ print @updated;
+ }
+ my @cvsoutput;
+ @cvsoutput= safe_pipe_capture(@cvs, 'status', @canstatusfiles);
+ my $matchcount = 0;
+ foreach my $l (@cvsoutput) {
+ chomp $l;
+ if ( $l =~ /^File:/ and $l =~ /Status: (.*)$/ ) {
+ $cvsstat{$canstatusfiles[$matchcount]} = $1;
+ $matchcount++;
+ }
+ }
}
# ... validate new files,
foreach my $f (@afiles) {
- if (defined ($cvsstat{$f}) and $cvsstat{$f} ne "Unknown") {
- $dirty = 1;
- warn "File $f is already known in your CVS checkout -- perhaps it has been added by another user. Or this may indicate that it exists on a different branch. If this is the case, use -f to force the merge.\n";
- warn "Status was: $cvsstat{$f}\n";
- }
+ if (defined ($cvsstat{$f}) and $cvsstat{$f} ne "Unknown") {
+ $dirty = 1;
+ warn "File $f is already known in your CVS checkout -- perhaps it has been added by another user. Or this may indicate that it exists on a different branch. If this is the case, use -f to force the merge.\n";
+ warn "Status was: $cvsstat{$f}\n";
+ }
}
# ... validate known files.
foreach my $f (@files) {
- next if grep { $_ eq $f } @afiles;
- # TODO:we need to handle removed in cvs
- unless (defined ($cvsstat{$f}) and $cvsstat{$f} eq "Up-to-date") {
- $dirty = 1;
- warn "File $f not up to date but has status '$cvsstat{$f}' in your CVS checkout!\n";
- }
+ next if grep { $_ eq $f } @afiles;
+ # TODO:we need to handle removed in cvs
+ unless (defined ($cvsstat{$f}) and $cvsstat{$f} eq "Up-to-date") {
+ $dirty = 1;
+ warn "File $f not up to date but has status '$cvsstat{$f}' in your CVS checkout!\n";
+ }
}
if ($dirty) {
- if ($opt_f) { warn "The tree is not clean -- forced merge\n";
- $dirty = 0;
- } else {
- die "Exiting: your CVS tree is not clean for this merge.";
- }
+ if ($opt_f) {
+ warn "The tree is not clean -- forced merge\n";
+ $dirty = 0;
+ } else {
+ die "Exiting: your CVS tree is not clean for this merge.";
+ }
}
print "Applying\n";
@@ -220,30 +221,30 @@ print "Applying\n";
print "Patch applied successfully. Adding new files and directories to CVS\n";
my $dirtypatch = 0;
foreach my $d (@dirs) {
- if (system(@cvs,'add',$d)) {
- $dirtypatch = 1;
- warn "Failed to cvs add directory $d -- you may need to do it manually";
- }
+ if (system(@cvs,'add',$d)) {
+ $dirtypatch = 1;
+ warn "Failed to cvs add directory $d -- you may need to do it manually";
+ }
}
foreach my $f (@afiles) {
- if (grep { $_ eq $f } @bfiles) {
- system(@cvs, 'add','-kb',$f);
- } else {
- system(@cvs, 'add', $f);
- }
- if ($?) {
- $dirtypatch = 1;
- warn "Failed to cvs add $f -- you may need to do it manually";
- }
+ if (grep { $_ eq $f } @bfiles) {
+ system(@cvs, 'add','-kb',$f);
+ } else {
+ system(@cvs, 'add', $f);
+ }
+ if ($?) {
+ $dirtypatch = 1;
+ warn "Failed to cvs add $f -- you may need to do it manually";
+ }
}
foreach my $f (@dfiles) {
- system(@cvs, 'rm', '-f', $f);
- if ($?) {
- $dirtypatch = 1;
- warn "Failed to cvs rm -f $f -- you may need to do it manually";
- }
+ system(@cvs, 'rm', '-f', $f);
+ if ($?) {
+ $dirtypatch = 1;
+ warn "Failed to cvs rm -f $f -- you may need to do it manually";
+ }
}
print "Commit to CVS\n";
@@ -252,25 +253,25 @@ my @commitfiles = map { unless (m/\s/) { '\''.$_.'\''; } else { $_; }; } (@files
my $cmd = join(' ', @cvs)." commit -F .msg @commitfiles";
if ($dirtypatch) {
- print "NOTE: One or more hunks failed to apply cleanly.\n";
- print "You'll need to apply the patch in .cvsexportcommit.diff manually\n";
- print "using a patch program. After applying the patch and resolving the\n";
- print "problems you may commit using:";
- print "\n $cmd\n\n";
- exit(1);
+ print "NOTE: One or more hunks failed to apply cleanly.\n";
+ print "You'll need to apply the patch in .cvsexportcommit.diff manually\n";
+ print "using a patch program. After applying the patch and resolving the\n";
+ print "problems you may commit using:";
+ print "\n $cmd\n\n";
+ exit(1);
}
if ($opt_c) {
- print "Autocommit\n $cmd\n";
- print safe_pipe_capture(@cvs, 'commit', '-F', '.msg', @files);
- if ($?) {
- die "Exiting: The commit did not succeed";
- }
- print "Committed successfully to CVS\n";
- # clean up
- unlink(".msg");
+ print "Autocommit\n $cmd\n";
+ print safe_pipe_capture(@cvs, 'commit', '-F', '.msg', @files);
+ if ($?) {
+ die "Exiting: The commit did not succeed";
+ }
+ print "Committed successfully to CVS\n";
+ # clean up
+ unlink(".msg");
} else {
- print "Ready for you to commit, just run:\n\n $cmd\n";
+ print "Ready for you to commit, just run:\n\n $cmd\n";
}
# clean up
@@ -292,25 +293,25 @@ END
# to work around shell problems with weird characters in arguments
# if the exec returns non-zero we die
sub safe_pipe_capture {
- my @output;
- if (my $pid = open my $child, '-|') {
- @output = (<$child>);
- close $child or die join(' ',@_).": $! $?";
- } else {
- exec(@_) or die "$! $?"; # exec() can fail the executable can't be found
- }
- return wantarray ? @output : join('',@output);
+ my @output;
+ if (my $pid = open my $child, '-|') {
+ @output = (<$child>);
+ close $child or die join(' ',@_).": $! $?";
+ } else {
+ exec(@_) or die "$! $?"; # exec() can fail the executable can't be found
+ }
+ return wantarray ? @output : join('',@output);
}
sub safe_pipe_capture_blob {
- my $output;
- if (my $pid = open my $child, '-|') {
- local $/;
- undef $/;
- $output = (<$child>);
- close $child or die join(' ',@_).": $! $?";
- } else {
- exec(@_) or die "$! $?"; # exec() can fail the executable can't be found
- }
- return $output;
+ my $output;
+ if (my $pid = open my $child, '-|') {
+ local $/;
+ undef $/;
+ $output = (<$child>);
+ close $child or die join(' ',@_).": $! $?";
+ } else {
+ exec(@_) or die "$! $?"; # exec() can fail the executable can't be found
+ }
+ return $output;
}
--
1.5.3.4.209.g397ef-dirty
^ permalink raw reply related
* [PATCH 2/3] git-cvsexportcommit.perl tmpdir removed
From: Michael Witten @ 2007-10-16 8:08 UTC (permalink / raw)
To: git; +Cc: Michael Witten
In-Reply-To: <1192522094-4988-1-git-send-email-mfwitten@mit.edu>
Signed-off-by: Michael Witten <mfwitten@mit.edu>
---
This is perhaps a duplicate of another patch sent in,
but it applies to the tabified version.
git-cvsexportcommit.perl | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index b330c3d..869c8b5 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -30,9 +30,6 @@ if ($opt_d) {
@cvs = ('cvs');
}
-# setup a tempdir
-our ($tmpdir, $tmpdirname) = tempdir('git-cvsapplycommit-XXXXXX', TMPDIR => 1, CLEANUP => 1);
-
# resolve target commit
my $commit;
$commit = pop @ARGV;
--
1.5.3.4.207.g6d7480-dirty
^ permalink raw reply related
* RE: Is there any plan to support partial checkout or submoudule improvement?
From: franky @ 2007-10-16 9:56 UTC (permalink / raw)
To: 'Lars Hjemli'; +Cc: git
In-Reply-To: <8c5c35580710160142x1f699208gfc226072a27e997a@mail.gmail.com>
> Well, there is always
>
> $ git archive --remote=<repo> <revspec> <path> | tar -x
>
> This is effectively a partial checkout of an arbitrary revision from a
> remote repo.
>
> --
That's actually "a single command", but a little complex. And there still
are some problems with this single command
1. each time is full checkout (not incremental), so bad performance for
large bin directory
2. I can't know deployment version easily and I can't use "git-log" to see
the log and to decide which version to back to when necessary.
I just find an ugly resolution:
1. git-clone host:project.git project
Cloned project is as follows (src, bin are subdir instead of submodule)
project
src
bin
.git
2. cd project && rm -rf src
3. when project.git changed, then
git-fetch && git-checkout origin/master bin
Unfortulately, it's annoying when I run git-status which complains "deleted:
src ". And "git-log" will not show the newest log since git-checkout doesn't
update the index file
So, the alternative for the 3rd step is
git-pull && rm src
It's so ugly!
Suggestion 1: how about adding a paths option for git-status just like
git-diff and git-log
Suggestion 2: how about changes the default paths for "git-diff", "git-log"
and so on from the "top dir with .git" to "the current dir"? So when I'm in
bin directory and run "git-log", it will only report log or diff in bin
directory.
franky
^ permalink raw reply
* Re: [PATCH 1/5] Add a generic tree traversal to fetch SVN properties.
From: Eric Wong @ 2007-10-16 9:55 UTC (permalink / raw)
To: Benoit SIGOURE; +Cc: git
In-Reply-To: <07B09A42-73DD-4565-975F-A4E40BF862AC@lrde.epita.fr>
Benoit SIGOURE <tsuna@lrde.epita.fr> wrote:
> On Oct 16, 2007, at 9:43 AM, Eric Wong wrote:
>
> >Benoit Sigoure <tsuna@lrde.epita.fr> wrote:
> >> * git-svn.perl (&traverse_ignore): Remove.
> >> (&prop_walk): New.
> >> (&cmd_show_ignore): Use prop_walk.
> >>
> >>Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
> >
> >Although I myself have never needed this functionality, this series
> >looks pretty good in general.
>
> I heavily script Git with my own wrappers and having this sort if
> functionality does enhance the scriptability of git-svn.
Ah. I've actually wanted something like `svn info` or `git-svn
rev-parse` myself for a while, but haven't gotten to implementing it
myself, either. Something that could easily give me the current URL of
a repo, or the URL of any path in a repo
$ git svn info --remote-url local/path.c
=> https://example.com/svn/trunk/local/path.c
$ git svn info --url
=> https://example.com/svn/trunk
I think there was other functionality that I've wanted in the past
but have forgotten at the moment. I need to sleep, badly :x
> >Thanks.
>
> You're welcome :)
>
> >
> >One comment below about property selection (whitelist vs blacklist).
> >
> >
> >It would be possible to get identical information out of
> >unhandled.log,
> >but older repositories may not have complete information... Maybe
> >some
> >local option would be good for people with complete unhandled.log
> >files;
> >but it could be really incomplete/insufficient.
> >
>
> In order to avoid using SVN::Ra and avoid access to the SVN repo?
> Hmm, clever, I didn't think about this. Maybe we can provide both,
> the default would check unhandled.log and an option would enable
> direct access to the SVN repo?
Yes. I'm alright with the direct SVN repo code for now, and we can do
unhandled.log later since it's more things to do.
> >Coding style
> >
> >Other than that, I prefer to keep braces on the same line as foreach,
> >if, else statements. I generally follow the git and Linux coding
> >style for C in my Perl code.
> >
> >One exception that I make for Perl (but not C) is that I keep the "{"
> >for subs on the same line (since subs can be nested and anonymous ones
> >passed as arguments and such); unlike their C counterparts[1]
>
> Indeed, sorry, I started correctly but then completely forgot to
> follow the existing Coding Style. The CS I use daily is totally
> different, sorry ;)
> Shall I resend the patch series with corrected CS?
Yes, please. Thanks.
--
Eric Wong
^ permalink raw reply
* Re: .gitignore and svn:ignore [WAS: git-svn and submodules]
From: Karl Hasselström @ 2007-10-16 9:43 UTC (permalink / raw)
To: Eric Wong; +Cc: Chris Shoemaker, Benoit SIGOURE, git list, Johannes Schindelin
In-Reply-To: <20071016075827.GB32348@soma>
On 2007-10-16 00:58:27 -0700, Eric Wong wrote:
> If we support .gitignore <-> svn:ignore in git-svn; bidirectional,
> transparent mapping is the only way I want to go.
Fair enough.
> This means that *all* .gitignore files will be translated to
> svn:ignore files and vice versa; and the .gitignore files will be
> NOT be committed to SVN itself, but present in the git-svn created
> mirrors.
OK.
> Recursive .gitignore definitions will be mapped to svn:ignore
> recursively on the client side; and non-recursive ones will only map
> to one directory.
>
> Sound good?
>
> I may be sleepy at the moment, but the thought of implementing this
> is sounding complicated now...
I think this is a mistake. If a user adds *.foo to the top-level
.gitignore, this will add *.foo to svn:ignore of _every_ directory in
the whole tree. And coming up with semantics that are sane for e.g.
git -> svn -> git roundtrips seems difficult.
It would be better and far simpler to either
1. Move the contents of svn:ignore and .gitignore back and forth
untouched, disregarding the slight semantic mismatch.
git-svnignore does this (albeit only in one direction), and it
works surprisingly well in my experience.
2. Do as in (1), but call the file .svnignore instead of .gitignore.
And have a git-svn command that translates all the .svnignore
files in the tree to corresponding .gitignore files.
> One goal of git-svn is that other users shouldn't be able to tell if
> a user is using git-svn or plain svn; even.
Agreed.
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle
^ permalink raw reply
* Re: [PATCH 09/25] Port builtin-add.c to use the new option parser.
From: Michael Witten @ 2007-10-16 9:36 UTC (permalink / raw)
To: Pierre Habouzit; +Cc: git
In-Reply-To: <2209D123-A245-43C4-8DD9-A83386852556@mit.edu>
On 16 Oct 2007, at 4:55:41 AM, Michael Witten wrote:
> On 16 Oct 2007, at 4:39:42 AM, Pierre Habouzit wrote:
>
>> + OPT_BOOLEAN('u', NULL, &take_worktree_changes, "update only
>> files that git already knows about"),
>
> "update only files in the current directory that git already knows
> about"
Better grammar:
"update only files that git already knows about in the current
directory"
^ permalink raw reply
* Re: [PATCH 1/5] Add a generic tree traversal to fetch SVN properties.
From: Benoit SIGOURE @ 2007-10-16 9:35 UTC (permalink / raw)
To: Eric Wong; +Cc: git
In-Reply-To: <20071016074310.GA32254@soma>
[-- Attachment #1: Type: text/plain, Size: 3576 bytes --]
On Oct 16, 2007, at 9:43 AM, Eric Wong wrote:
> Benoit Sigoure <tsuna@lrde.epita.fr> wrote:
>> * git-svn.perl (&traverse_ignore): Remove.
>> (&prop_walk): New.
>> (&cmd_show_ignore): Use prop_walk.
>>
>> Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
>
> Although I myself have never needed this functionality, this series
> looks pretty good in general.
I heavily script Git with my own wrappers and having this sort if
functionality does enhance the scriptability of git-svn.
>
> Thanks.
You're welcome :)
>
> One comment below about property selection (whitelist vs blacklist).
>
>
> It would be possible to get identical information out of
> unhandled.log,
> but older repositories may not have complete information... Maybe
> some
> local option would be good for people with complete unhandled.log
> files;
> but it could be really incomplete/insufficient.
>
In order to avoid using SVN::Ra and avoid access to the SVN repo?
Hmm, clever, I didn't think about this. Maybe we can provide both,
the default would check unhandled.log and an option would enable
direct access to the SVN repo?
>
> I'm not sure about 5/5, it's purely a style issue, however I don't
> really feel strongly about a trailing "\n" either way...
> Nevertheless,
> it is definitely not part of this series and should be treated
> independently.
>
Indeed.
>
> Coding style
>
> Other than that, I prefer to keep braces on the same line as foreach,
> if, else statements. I generally follow the git and Linux coding
> style for C in my Perl code.
>
> One exception that I make for Perl (but not C) is that I keep the "{"
> for subs on the same line (since subs can be nested and anonymous ones
> passed as arguments and such); unlike their C counterparts[1]
Indeed, sorry, I started correctly but then completely forgot to
follow the existing Coding Style. The CS I use daily is totally
different, sorry ;)
Shall I resend the patch series with corrected CS?
>
> [1] - well, nesting functions is allowed in C99 or GNU C, I can't
> remember which or both...
>
GNU C, AFAIR.
>> ---
>> git-svn.perl | 66 +++++++++++++++++++++++++++++++++++++++
>> +-----------------
>> 1 files changed, 46 insertions(+), 20 deletions(-)
>>
>> diff --git a/git-svn.perl b/git-svn.perl
>> index 777e436..abc83ec 100755
>> --- a/git-svn.perl
>> +++ b/git-svn.perl
[...]
>
> How about having a blacklist (for the author, date, log, uuid?)
> instead
> of a whitelist? I can't remember all of them that should be
> blacklisted,
> but maybe it's just author, date and log)..
>
>> + my $interesting_props = 0;
>> + foreach(keys %{$props})
>> + {
>> + # If it doesn't start with `svn:', it must be a
>> + # user-defined property.
>> + ++$interesting_props and next if $_ !~ /^svn:/;
>> + # FIXME: Fragile, if SVN adds new public properties,
>> + # this needs to be updated.
>> + ++$interesting_props if /^svn:(?:ignore|keywords|executable
>> + |eol-style|mime-type
>> + |externals|needs-lock)$/x;
>> + }
Why not. I thought that the SVN internals were more subject to
change than the public "interface", hence the check.
>> + &$sub($self, $p, $props) if $interesting_props;
>> +
PS: For some reason, the introduction message didn't make its way to
the ML. I made a mistake when sending it because I first ran git
send-email --compose, then noticed that it sent only one mail, and
ran git send-email *.patch afterwards. Weird.
Cheers,
--
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]
^ permalink raw reply
* Re: [PATCH] Make the output of "git svn clone" less confusing.
From: Eric Wong @ 2007-10-16 9:32 UTC (permalink / raw)
To: David Kågedal; +Cc: git
In-Reply-To: <87k5poflp5.fsf@lysator.liu.se>
David Kågedal <davidk@lysator.liu.se> wrote:
> The problem is that the first thing it prints is
>
> Initialized empty Git repository in .git/
>
> even if actually created a subdirectory and changed into it first. But to the
> user, it looks like it is creating a .git/ dir in the directory he/she is
> started git from.
Thanks for bringing it up I just noticed this the other day myself and
thought it might be confusing.
> ---
> git-svn.perl | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> This change makes it more chatty, which might not be a good thing. But
> I think the previous output was worse.
>
> diff --git a/git-svn.perl b/git-svn.perl
> index 777e436..d4450ca 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -286,6 +286,7 @@ sub do_git_init_db {
>
> sub init_subdir {
> my $repo_path = shift or return;
> + print "Creating directory $repo_path\n";
> mkpath([$repo_path]) unless -d $repo_path;
> chdir $repo_path or die "Couldn't chdir to $repo_path: $!\n";
Since mkpath() isn't guaranteed to get called, maybe putting a
print "Entering directory $repo_path\n"
right before the chdir is better.
The other option would be to alter git-init to print the absolute path
of the repository being initialized...
--
Eric Wong
^ permalink raw reply
* Re: [PATCH 09/25] Port builtin-add.c to use the new option parser.
From: Michael Witten @ 2007-10-16 8:55 UTC (permalink / raw)
To: Pierre Habouzit; +Cc: git
In-Reply-To: <1192523998-19474-9-git-send-email-madcoder@debian.org>
On 16 Oct 2007, at 4:39:42 AM, Pierre Habouzit wrote:
> + OPT_BOOLEAN('u', NULL, &take_worktree_changes, "update only files
> that git already knows about"),
"update only files in the current directory that git already knows
about"
^ permalink raw reply
* Re: How to Import a bitkeeper repo into git
From: Marco Costalba @ 2007-10-16 9:11 UTC (permalink / raw)
To: pete; +Cc: Linus Torvalds, VMiklos, free cycle, git
In-Reply-To: <471454B5.7040802@bluelane.com>
On 10/16/07, Pete/Piet Delaney <pete@bluelane.com> wrote:
>
> It's not quite a intuitive/familiar as with bitkeeper. I suspect I just
> need some practice. I selected a huge list if files that we use to
> filter the release with and double clicked on the file I thought showing
> to focus on that file. The I pulled down External Diff and it took for
> ever; like it's confused.
>
You shoudl select only _one_ additional revision.
The currenlty selected revision is the base + select another one
(only) with CTRL + *RIGHT* click (the file list change background
color) , then call external diff tool.
> Often we/I want to see the rev history for a particular file.
> How would you do that with Qgit?
>
Select the file from the file list (right bottom pane) or from the
tree view (use key 't' to toggle treev view) double click on it or use
context menu (right click on the file name) and that's all.
>
> Can I see just the revs for a particular file?
>
See above.
I know I'm going to tell you a very _unpopular_ thing, but, in case
you have 5 minutes of spare time (yes, it doesn't take longer), open
qgit then please press a nice key called 'F1', a nice handbook will
appear...
I really suggest to look at it. To keep UI 'clean' a lot of features
are not immediatly visible, so reading the handbook (at least the
chapter's titiles) would give you a better idea of what qgit could do
for you.
>
> I'll get the latest and greatest. Thinks. Often the problem is
> having the current version of Qt3. My workstation is Mandrake
> 1005 Limited Edition (X11 Xinerama works on this release).
> Looks like I have Qt3 on my workstation. Would it be worthwhile
> to install Qt4 from src and try to use qgit-2.0?
>
Yes it is. There are a lot of new featrures, is almost as stable as
the previous and if you are interested in file history (annotations)
in qgit-2.0 this feature has been greatly speeded up.
Have fun
Marco
^ permalink raw reply
* Re: On Tabs and Spaces
From: Lars Hjemli @ 2007-10-16 9:04 UTC (permalink / raw)
To: Adam Piatyszek; +Cc: Michael Witten, git
In-Reply-To: <471476B7.5050105@users.sourceforge.net>
On 10/16/07, Adam Piatyszek <ediap@users.sourceforge.net> wrote:
> I am kindly asking for some tips on configuring
> Emacs and Vim to follow the rules used for Git and kernel code
> indentation/alignment.
>From http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/CodingStyle;h=7f1730f1a1ae2e9a6f368bdb10ff65f4568863d5;hb=HEAD
(defun linux-c-mode ()
"C mode with adjusted defaults for use with the Linux kernel."
(interactive)
(c-mode)
(c-set-style "K&R")
(setq tab-width 8)
(setq indent-tabs-mode t)
(setq c-basic-offset 8))
And to use this only in a specific directory:
(setq auto-mode-alist (cons '("/usr/src/linux.*/.*\\.[ch]$" . linux-c-mode)
auto-mode-alist))
--
larsh
^ permalink raw reply
* [PATCH] gitweb: Speed up get_projects_list for large source trees
From: Luke Lu @ 2007-10-16 9:04 UTC (permalink / raw)
To: git
In-Reply-To: <vpqlka3sdka.fsf@bauges.imag.fr>
Hi, I've been using git for a month now and loving it. This is my
first ever patch for git using git. I spent sometime to find out why
the project listing is taking 200s, everytime! I guess that gitweb is
mostly used to serve bare repositories, which would never encounter
such problems. It takes .2s, after the patch on my laptop. That's
1000x improvement for me (on Mac OS X 1.4.10.)
__Luke
Signed-off-by: Luke Lu <git@vicaya.com>
---
gitweb/gitweb.perl | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 3064298..a30eef9 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1509,16 +1509,20 @@ sub git_get_projects_list {
# remove the trailing "/"
$dir =~ s!/+$!!;
my $pfxlen = length("$dir");
+ my $pfxdepth = ($dir =~ tr!/!!);
File::Find::find({
follow_fast => 1, # follow symbolic links
follow_skip => 2, # ignore duplicates
+ no_chdir => 1, # don't chdir into every directory
dangling_symlinks => 0, # ignore dangling symlinks, silently
wanted => sub {
# skip project-list toplevel, if we get it.
return if (m!^[/.]$!);
# only directories can be git repositories
return unless (-d $_);
+ # don't traverse too deep (Find is super slow on os x)
+ return if tr!/!! - $pfxdepth > 2 && ($File::Find::prune = 1);
my $subdir = substr($File::Find::name, $pfxlen + 1);
# we check related file in $projectroot
--
1.5.3.4
^ permalink raw reply related
* Re: should git command and git-command be equivalent?
From: Matthieu Moy @ 2007-10-16 8:55 UTC (permalink / raw)
To: franky; +Cc: git
In-Reply-To: <20071016084800.270917E6F@mail.kooxoo.com>
"franky" <yinping@kooxoo.com> writes:
>> Also, you can use aliases (for example, I type "git st" to do "git
>> status") with "git whatever", but not with "git-whatever" (unless you
>> define the alias in your shell).
> I try "git st", but it complains "git: 'st' is not a git-command".
Sure, I'm talking about aliases, so what I meant is that I had
[alias]
st = status
in ~/.gitconfig.
> Instead, I use gt-beginning abbreviation for some command frequently used
> such as gtci->git-commit, gtco-->git-checkout, gtst-->git-status,
> gtdi->git-diff, gtinit->git-init
>
> So it will be wonderful if I can use "gtinit --bare"
You can't without defining gtinit as a simple-but-not-totally-trivial
wrapper script.
But you can define an alias to init, to enable you to type
$ git --bare i
(that said, it could be a good idea for "git init" to accept --bare as
an option too).
--
Matthieu
^ permalink raw reply
* RE: should git command and git-command be equivalent?
From: franky @ 2007-10-16 8:47 UTC (permalink / raw)
To: 'Matthieu Moy'; +Cc: git
In-Reply-To: <vpqprzfsdo3.fsf@bauges.imag.fr>
> Also, you can use aliases (for example, I type "git st" to do "git
> status") with "git whatever", but not with "git-whatever" (unless you
> define the alias in your shell).
I try "git st", but it complains "git: 'st' is not a git-command".
Instead, I use gt-beginning abbreviation for some command frequently used
such as gtci->git-commit, gtco-->git-checkout, gtst-->git-status,
gtdi->git-diff, gtinit->git-init
So it will be wonderful if I can use "gtinit --bare"
> --
> Matthieu
> -
> 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
^ permalink raw reply
* Re: [PATCH 07/25] parse-options: make some arguments optional, add callbacks.
From: Pierre Habouzit @ 2007-10-16 8:45 UTC (permalink / raw)
To: git, Shawn O. Pearce
In-Reply-To: <1192523998-19474-7-git-send-email-madcoder@debian.org>
[-- Attachment #1: Type: text/plain, Size: 647 bytes --]
This bit is to allow to aggregate options with arguments together when
the argument is numeric.
+#if 0
+ /* can be used to understand -A1B1 like -A1 -B1 */
+ if (flag & OPT_SHORT && opt->opt && isdigit(*opt->opt)) {
+ *(int *)opt->value = strtol(opt->opt, (char **)&opt->opt, 10);
+ return 0;
+ }
+#endif
I'm not a huge fan, but people may like it. Feel free to keep the
chunk, drop it, or enable it to your liking.
--
·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: [parse-options] proposal for merge, take 1
From: Pierre Habouzit @ 2007-10-16 8:43 UTC (permalink / raw)
To: git, Shawn O. Pearce
In-Reply-To: <20071016082010.GD6919@artemis.corp>
[-- Attachment #1: Type: text/plain, Size: 3266 bytes --]
On mar, oct 16, 2007 at 08:20:10 +0000, Pierre Habouzit wrote:
> On mar, oct 16, 2007 at 08:16:31 +0000, Pierre Habouzit wrote:
> > The branch is available from git://git.madism.org/git.git in the topic
> > branch ph/parseopt. I just rebased it onto the last "next" spearce
> > produced.
>
> > Make builtin-pack-objects.c use parse_options.
>
> ERRR DON'T TAKE 25/25, it's WIP and is broken atm, format-patch again
> hasn't DWIM. It is not pushed to git://git.madism.org/git.git btw.
okay I'm wrong, sorry for the alarm, I just generated the --stat and shortlog
too broadly, but 25/25 is definitely OK.
Proper stats for part2 are:
Jonas Fonseca (1):
Update manpages to reflect new short and long option aliases
Kristian Høgsberg (1):
Port builtin-add.c to use the new option parser.
Pierre Habouzit (15):
Make builtin-rm.c use parse_options.
Make builtin-mv.c use parse-options
Make builtin-branch.c use parse_options.
Make builtin-describe.c use parse_options
Make builtin-fetch.c use parse_options.
Make builtin-revert.c use parse_options.
Make builtin-update-ref.c use parse_options
Make builtin-symbolic-ref.c use parse_options.
Make builtin-http-fetch.c use parse_options.
Make builtin-for-each-ref.c use parse-opts.
Make builtin-fsck.c use parse_options.
Make builtin-count-objects.c use parse_options.
Make builtin-name-rev.c use parse_options.
Make builtin-pack-refs.c use parse_options.
Make builtin-show-ref.c use parse_options [small backward incompatibility].
Documentation/git-add.txt | 4 +-
Documentation/git-branch.txt | 2 +-
Documentation/git-mv.txt | 2 +-
Documentation/git-rm.txt | 4 +-
Documentation/git-show-ref.txt | 4 +-
Documentation/git-symbolic-ref.txt | 2 +-
builtin-add.c | 70 ++++++-----------
builtin-branch.c | 147 +++++++++++++-----------------------
builtin-count-objects.c | 32 ++++----
builtin-describe.c | 70 +++++++----------
builtin-fetch.c | 146 ++++++++++++------------------------
builtin-for-each-ref.c | 138 +++++++++++++++-------------------
builtin-fsck.c | 80 ++++++-------------
builtin-http-fetch.c | 65 +++++++---------
builtin-mv.c | 84 +++++++++------------
builtin-name-rev.c | 64 ++++++----------
builtin-pack-refs.c | 47 +++++-------
builtin-revert.c | 67 +++++++---------
builtin-rm.c | 54 ++++++--------
builtin-show-ref.c | 127 +++++++++++--------------------
builtin-symbolic-ref.c | 52 +++++--------
builtin-update-ref.c | 65 ++++++----------
22 files changed, 515 insertions(+), 811 deletions(-)
--
·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: Is there any plan to support partial checkout or submoudule improvement?
From: Lars Hjemli @ 2007-10-16 8:42 UTC (permalink / raw)
To: franky; +Cc: git
In-Reply-To: <20071016082720.E5EDA7E6F@mail.kooxoo.com>
On 10/16/07, franky <yinping@kooxoo.com> wrote:
> I want a single "git-pull" to deploy a new version and a
> single "git-reset" to back to versions before
Well, there is always
$ git archive --remote=<repo> <revspec> <path> | tar -x
This is effectively a partial checkout of an arbitrary revision from a
remote repo.
--
larsh
^ 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