* Git error on Cygwin
From: Claudio Scordino @ 2007-07-30 17:18 UTC (permalink / raw)
To: git
Hi all,
I just installed cygwin on Windows XP and I have the following error when
using git-clone.
(Consider that the same command on the same repository works on Linux).
Regards,
Claudio
$ git-clone <username>@<host>:/<path>/<project>
Initialized empty Git repository in /home/Claudio/<project>/.git/
<username>@<host>'s password:
remote: Generating pack...
remote: Done counting 30387 objects.
remote: Deltifying 30387 objects...
remote: 100% (30387/30387) done
Indexing 30387 objects...
remote: Total 30387 (delta 4446), reused 30188 (delta 4351)
100% (30387/30387) done
Resolving 4446 deltas...
100% (4446/4446) done
3 [main] git-read-tree 2160 C:\cygwin\bin\git-read-tree.exe: *** fatal
error - could not load shell32, Win32 error 487
/usr/bin/git-clone: line 404: 2160 Hangup git-read-tree -m -u
$v HEAD HEAD
^ permalink raw reply
* Re: Git error on Cygwin
From: Alex Riesen @ 2007-07-31 7:51 UTC (permalink / raw)
To: Claudio Scordino; +Cc: git
In-Reply-To: <46AE1D77.8040609@gmail.com>
On 7/30/07, Claudio Scordino <cloud.of.andor@gmail.com> wrote:
> Hi all,
>
> I just installed cygwin on Windows XP and I have the following error when
> using git-clone.
>
> (Consider that the same command on the same repository works on Linux).
Definitely.
> $ git-clone <username>@<host>:/<path>/<project>
> Initialized empty Git repository in /home/Claudio/<project>/.git/
> <username>@<host>'s password:
> remote: Generating pack...
> remote: Done counting 30387 objects.
> remote: Deltifying 30387 objects...
> remote: 100% (30387/30387) done
> Indexing 30387 objects...
> remote: Total 30387 (delta 4446), reused 30188 (delta 4351)
> 100% (30387/30387) done
> Resolving 4446 deltas...
> 100% (4446/4446) done
> 3 [main] git-read-tree 2160 C:\cygwin\bin\git-read-tree.exe: *** fatal
> error - could not load shell32, Win32 error 487
> /usr/bin/git-clone: line 404: 2160 Hangup git-read-tree -m -u
> $v HEAD HEAD
Report this to cygwin team. Try rerunning the command, usually
it helps (typical workaround for cygwin).
^ permalink raw reply
* Re: Efficient way to import snapshots?
From: Florian Weimer @ 2007-07-31 7:54 UTC (permalink / raw)
To: git
In-Reply-To: <85odht3xd1.fsf@lola.goethe.zz>
* David Kastrup:
> a) one thread for opendir/readdir at every directory level
> b) one thread for stating the files in readdir order (more likely to
> correspond to the disk layout than sorted order)
Not true for ext3. You need to sort by the d_ino field. This also
tends to be benefit other file systems more than readdir order.
^ permalink raw reply
* Re: "git stash" is not known to git
From: Junio C Hamano @ 2007-07-31 8:20 UTC (permalink / raw)
To: Jeff King; +Cc: git, David Kastrup, Linus Torvalds
In-Reply-To: <20070730100408.GA8829@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> We never actually look in the regular PATH since we call execv_git_cmd
> (although we do still munge the PATH, apparently so shell scripts can
> use git-foo syntax; see 77cb17e9). This means you can't drop "git-foo"
> into your PATH and have it work as "git foo".
Would this be a good replacement?
diff --git a/git.c b/git.c
index 2433355..25b8274 100644
--- a/git.c
+++ b/git.c
@@ -448,11 +448,11 @@ int main(int argc, const char **argv)
cmd = argv[0];
/*
- * We search for git commands in the following order:
- * - git_exec_path()
- * - the path of the "git" command if we could find it
- * in $0
- * - the regular PATH.
+ * We execute external git command via execv_git_cmd(),
+ * which looks at "--exec-path" option, GIT_EXEC_PATH
+ * environment, and $(gitexecdir) in Makefile while built,
+ * in this order. For scripted commands, we prepend
+ * the value of the exec_path variable to the PATH.
*/
if (exec_path)
prepend_to_path(exec_path, strlen(exec_path));
^ permalink raw reply related
* Re: Efficient way to import snapshots?
From: David Kastrup @ 2007-07-31 8:48 UTC (permalink / raw)
To: git
In-Reply-To: <87r6mpj9dd.fsf@mid.deneb.enyo.de>
Florian Weimer <fw@deneb.enyo.de> writes:
> * David Kastrup:
>
>> a) one thread for opendir/readdir at every directory level
>> b) one thread for stating the files in readdir order (more likely to
>> correspond to the disk layout than sorted order)
>
> Not true for ext3. You need to sort by the d_ino field. This also
> tends to be benefit other file systems more than readdir order.
Uh, yes, for stating it would (I actually though alphabetic sort order
here, and that would not likely help). So we just introduce another
thread a2) that sorts the partial list from a) as long as b) is still
busy stating... But I guess that a2) would be a thread that will
likely not cause much of a speedup.
--
David Kastrup
^ permalink raw reply
* Re: [PATCH] git.el: Support for incremental status updates.
From: David Kågedal @ 2007-07-31 9:19 UTC (permalink / raw)
To: git
In-Reply-To: <20070730232226.GA2413@diana.vm.bytemark.co.uk>
Karl Hasselström <kha@treskal.com> writes:
> On 2007-07-24 12:12:47 +0200, Alexandre Julliard wrote:
>
>> + (if node (ewoc-set-data node info) (ewoc-enter-last status info))))
>
> My emacs doesn't like this. When i do "a" or "U" (and quite possibly
> others that I haven't tried yet) I get
>
> git-insert-fileinfo: Symbol's function definition is void: ewoc-set-data
You probably need to add a (require 'ewoc). Try loading ewoc and run
the command again.
--
David Kågedal
^ permalink raw reply
* git-svn and distributed git
From: Väinö Järvelä @ 2007-07-31 9:42 UTC (permalink / raw)
To: git
Hello,
I have just started using git, so I don't have a lot of experience on
it, and I also haven't used it in a distributed environment, just as
a single developer on one of my personal projects.
Now I'm trying to use git at work through git-svn. git-svn cloned the
Subversion repository okay, and using git and dcommitting to
Subversion also works fine. The problems started when i tried to use
the git-svn repository in a distributed fashion.
Here's the thing: I'm developing a server software, locally and on a
pre-production server. The pre-production test server (just called
the server for now on) is on a DMZ network, which cannot access our
Subversion server. So I thought I could push the git repository to
the server to update the code, which works fine too. But sometimes
when there is a problem, I'll just develop the fix on the server
itself, instead of on my laptop (local development). I would like to
be able to pull the changes made on the server, back to my laptop,
and dcommit it to the Subversion server from there.
The problem is, that git-svn changes all the commits, and pushing to
the server repository won't work anymore. I can force a push, but
then there will be two commits per every commit pulled from the server.
I have thought about using two branches on the server, master, which
will only include commits already processed through git-svn, and dev,
which is used to pull the "local" changes to be committed to
Subversion. But my inexperience with git got me here, and I can't
seem to be able to get any updates from the other branch. And I'm not
even sure if this is the right approach to this problem.
What kind of approach/workflow would you use in a similar situation?
Regards,
Väinö Järvelä
^ permalink raw reply
* Re: [RFH PATCH] Teach the emacs git mode about core.excludesfile
From: Alexandre Julliard @ 2007-07-31 10:36 UTC (permalink / raw)
To: Karl Hasselström; +Cc: git
In-Reply-To: <20070731011100.23561.27554.stgit@yoghurt>
Karl Hasselström <kha@treskal.com> writes:
> This is a Request For Help. The patch works, but is clearly the work
> of someone who is not very fluent in elisp. Just look at all that
> duplicated code I've introduced!
I would do it this way:
From: Alexandre Julliard <julliard@winehq.org>
Date: Tue, 31 Jul 2007 12:19:05 +0200
Subject: [PATCH] git.el: Take into account the core.excludesfile config option.
Also don't require .git/info/exclude to exist in order to list unknown
files.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
contrib/emacs/git.el | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index 53dd703..9bcd7c4 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -589,6 +589,16 @@ Return the list of files that haven't been handled."
(when node (push (ewoc-data node) unmerged-files))))
(git-set-files-state unmerged-files 'unmerged))))
+(defun git-get-exclude-files ()
+ "Get the list of exclude files to pass to git-ls-files."
+ (let (files
+ (config (git-config "core.excludesfile")))
+ (when (file-readable-p ".git/info/exclude")
+ (push ".git/info/exclude" files))
+ (when (and config (file-readable-p config))
+ (push config files))
+ files))
+
(defun git-update-status-files (files &optional default-state)
"Update the status of FILES from the index."
(unless git-status (error "Not in git-status buffer."))
@@ -598,11 +608,11 @@ Return the list of files that haven't been handled."
(git-run-ls-files status files 'added "-c")
(git-run-diff-index status files))))
(git-run-ls-unmerged status files)
- (when (and (or (not files) remaining-files)
- (file-readable-p ".git/info/exclude"))
- (setq remaining-files (git-run-ls-files status remaining-files
- 'unknown "-o" "--exclude-from=.git/info/exclude"
- (concat "--exclude-per-directory=" git-per-dir-ignore-file))))
+ (when (or (not files) remaining-files)
+ (let ((exclude-files (git-get-exclude-files)))
+ (setq remaining-files (apply #'git-run-ls-files status remaining-files 'unknown "-o"
+ (concat "--exclude-per-directory=" git-per-dir-ignore-file)
+ (mapcar (lambda (f) (concat "--exclude-from=" f)) exclude-files)))))
; mark remaining files with the default state (or remove them if nil)
(when remaining-files
(if default-state
--
1.5.3.rc3.92.g70c7b
--
Alexandre Julliard
julliard@winehq.org
^ permalink raw reply related
* Re: git-gui i18n / 0.9.x plans
From: Johannes Schindelin @ 2007-07-31 10:47 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: Christian Stimming, git
In-Reply-To: <20070731012804.GZ20052@spearce.org>
Hi,
On Mon, 30 Jul 2007, Shawn O. Pearce wrote:
> Regarding future development for the off-in-the-future 0.9.0 release I'd
> like to see the i18n work merge in before we do anything else major to
> git-gui.
Very good! As it happens, I pushed an update this morning.
temp-rebase-to-shawns-master is the branch which forward-ported all
patches to the current master of git-gui.git.
As I understand, Christian will find and mark all strings lacking [mc ...]
and update the .pot file. Then we'll kindly ask the good translators
(thanks everyone!) to review the changes, and after that I'll prepare some
submittable patch series (no need to have several patches per language).
> - Hunk splitting/selection
Yeah, I am personally interested in this, so time permitting I will
continue on that part. Regarding your idea from another post of yours:
IMHO selections are only meaningful if they take whole lines. But that's
almost like hunk splitting, so it should be easy to support with the code
I wrote and will have written.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH] git.el: Support for incremental status updates.
From: Karl Hasselström @ 2007-07-31 11:14 UTC (permalink / raw)
To: David Kågedal; +Cc: git
In-Reply-To: <87k5shudz7.fsf@morpheus.local>
On 2007-07-31 11:19:56 +0200, David Kågedal wrote:
> Karl Hasselström <kha@treskal.com> writes:
>
> > On 2007-07-24 12:12:47 +0200, Alexandre Julliard wrote:
> >
> > > + (if node (ewoc-set-data node info) (ewoc-enter-last status info))))
> >
> > My emacs doesn't like this. When i do "a" or "U" (and quite
> > possibly others that I haven't tried yet) I get
> >
> > git-insert-fileinfo: Symbol's function definition is void: ewoc-set-data
>
> You probably need to add a (require 'ewoc). Try loading ewoc and run
> the command again.
git.el already requires ewoc. And it uses a number of ewoc functions
(and has done so since its creation); this newly introduced call is
the only one that fails.
Also, I've just discovered that with Emacs 22.1, I don't see this
problem. So my guess is that ewoc-set-data is newer than Emacs 21.4.
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle
^ permalink raw reply
* [PATCH 1/2] gitweb: Allow for multivalued parameters passed to href subroutine
From: Jakub Narebski @ 2007-07-31 11:19 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski
Make it possible to generate URLs with multivalued parameters in the
href() subroutine, via passing reference to array of values.
Example:
href(action=>"log", extra_options=>["--no-merges", "--first-parent"])
This also allows for easy passing back (replaying) current value
of, possibly multivalued, extra_options ('opt') parameter, using:
href(..., extra_options=>\@extra_options)
which would be required when we start using extra_options in gitweb,
and would want to preserve its value. For example when creating links
to next/previous page of 'log' or 'history' view output, we would want
to preserve '--no-merges' and/or '-first-parent' extra options.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This is the same patch as sent earlier, but with more detailed commit
message. As the previous version made it into git.git, this is just
for archives.
gitweb/gitweb.perl | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 8a32899..498b936 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -629,7 +629,13 @@ sub href(%) {
for (my $i = 0; $i < @mapping; $i += 2) {
my ($name, $symbol) = ($mapping[$i], $mapping[$i+1]);
if (defined $params{$name}) {
- push @result, $symbol . "=" . esc_param($params{$name});
+ if (ref($params{$name}) eq "ARRAY") {
+ foreach my $par (@{$params{$name}}) {
+ push @result, $symbol . "=" . esc_param($par);
+ }
+ } else {
+ push @result, $symbol . "=" . esc_param($params{$name});
+ }
}
}
$href .= "?" . join(';', @result) if scalar @result;
--
1.5.2.4
^ permalink raw reply related
* [RFC/PATCH 2/2] gitweb: Add an option to show size of blobs in the tree view
From: Jakub Narebski @ 2007-07-31 11:19 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski
In-Reply-To: <1185880790812-git-send-email-jnareb@gmail.com>
Add support for extra option ('opt' parameter) '-l' for the 'tree'
view, to show (in separate column, between mode and filename) the size
of blobs (files). This option is passed through to all the 'tree'
links, so from 'tree' view with size of blobs on go to 'tree' view
also with size of blobs.
For the 'tree' and 'commit' (submodule) entries, '-' is shown in place
of size.
Currently you have to add ";opt=-l" to URL by hand to start.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This patch is an example of using infrastructure introduced by the
earlier patch:
gitweb: Allow for multivalued parameters passed to href subroutine
It allows to play with 'tree' view with blob size. Currently you
have to start browsing by adding ";opt=-l" to the gitweb URL by
hand. There is not link which will change view from ordinary 'tree'
view to 'tree' view with blob sizes.
The 'tree' with blob size view is slightly more costly than the
ordinary, old 'tree' view, but not much more (0.018s vs 0.012s
in the hot cache case), so I don't think we need to control it
as a enabled (or disabled) feature, overrideable or not. It
probably should not be default.
What do you think about this?
gitweb/gitweb.css | 5 ++++
gitweb/gitweb.perl | 53 ++++++++++++++++++++++++++++++++++++++-------------
2 files changed, 44 insertions(+), 14 deletions(-)
diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css
index 096313b..dd24546 100644
--- a/gitweb/gitweb.css
+++ b/gitweb/gitweb.css
@@ -326,6 +326,11 @@ td.mode {
font-family: monospace;
}
+td.size {
+ font-family: monospace;
+ text-align: right;
+}
+
/* styling of diffs (patchsets): commitdiff and blobdiff views */
div.diff.header,
div.diff.extended_header {
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 498b936..97ad1da 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -432,6 +432,7 @@ if (defined $hash_base) {
my %allowed_options = (
"--no-merges" => [ qw(rss atom log shortlog history) ],
+ "-l" => [ qw(tree) ],
);
our @extra_options = $cgi->param('opt');
@@ -1998,16 +1999,31 @@ sub parse_ls_tree_line ($;%) {
my %opts = @_;
my %res;
- #'100644 blob 0fa3f3a66fb6a137f6ec2c19351ed4d807070ffa panic.c'
- $line =~ m/^([0-9]+) (.+) ([0-9a-fA-F]{40})\t(.+)$/s;
+ if ($opts{'-l'}) {
+ #'100644 blob 0fa3f3a66fb6a137f6ec2c19351ed4d807070ffa 16717 panic.c'
+ $line =~ m/^([0-9]+) (.+) ([0-9a-fA-F]{40}) +(-|[0-9]+)\t(.+)$/s;
- $res{'mode'} = $1;
- $res{'type'} = $2;
- $res{'hash'} = $3;
- if ($opts{'-z'}) {
- $res{'name'} = $4;
+ $res{'mode'} = $1;
+ $res{'type'} = $2;
+ $res{'hash'} = $3;
+ $res{'size'} = $4;
+ if ($opts{'-z'}) {
+ $res{'name'} = $5;
+ } else {
+ $res{'name'} = unquote($5);
+ }
} else {
- $res{'name'} = unquote($4);
+ #'100644 blob 0fa3f3a66fb6a137f6ec2c19351ed4d807070ffa panic.c'
+ $line =~ m/^([0-9]+) (.+) ([0-9a-fA-F]{40})\t(.+)$/s;
+
+ $res{'mode'} = $1;
+ $res{'type'} = $2;
+ $res{'hash'} = $3;
+ if ($opts{'-z'}) {
+ $res{'name'} = $4;
+ } else {
+ $res{'name'} = unquote($4);
+ }
}
return wantarray ? %res : \%res;
@@ -2679,6 +2695,9 @@ sub git_print_tree_entry {
# and link is the action links of the entry.
print "<td class=\"mode\">" . mode_str($t->{'mode'}) . "</td>\n";
+ if (exists $t->{'size'}) {
+ print "<td class=\"size\">$t->{'size'}</td>\n";
+ }
if ($t->{'type'} eq "blob") {
print "<td class=\"list\">" .
$cgi->a({-href => href(action=>"blob", hash=>$t->{'hash'},
@@ -4268,8 +4287,9 @@ sub git_tree {
$hash = $hash_base;
}
}
+
$/ = "\0";
- open my $fd, "-|", git_cmd(), "ls-tree", '-z', $hash
+ open my $fd, "-|", git_cmd(), "ls-tree", '-z', @extra_options, $hash
or die_error(undef, "Open git-ls-tree failed");
my @entries = map { chomp; $_ } <$fd>;
close $fd or die_error(undef, "Reading tree failed");
@@ -4280,6 +4300,7 @@ sub git_tree {
git_header_html();
my $basedir = '';
my ($have_blame) = gitweb_check_feature('blame');
+ my $show_sizes = grep(/^-l$/, @extra_options);
if (defined $hash_base && (my %co = parse_commit($hash_base))) {
my @views_nav = ();
if (defined $file_name) {
@@ -4288,7 +4309,8 @@ sub git_tree {
hash=>$hash, file_name=>$file_name)},
"history"),
$cgi->a({-href => href(action=>"tree",
- hash_base=>"HEAD", file_name=>$file_name)},
+ hash_base=>"HEAD", file_name=>$file_name,
+ extra_options=>\@extra_options)},
"HEAD"),
}
my $snapshot_links = format_snapshot_links($hash);
@@ -4296,7 +4318,8 @@ sub git_tree {
# FIXME: Should be available when we have no hash base as well.
push @views_nav, $snapshot_links;
}
- git_print_page_nav('tree','', $hash_base, undef, undef, join(' | ', @views_nav));
+ git_print_page_nav('tree','', $hash_base, undef, undef,
+ join(' | ', @views_nav));
git_print_header_div('commit', esc_html($co{'title'}) . $ref, $hash_base);
} else {
undef $hash_base;
@@ -4330,8 +4353,10 @@ sub git_tree {
# based on git_print_tree_entry
print '<td class="mode">' . mode_str('040000') . "</td>\n";
print '<td class="list">';
- print $cgi->a({-href => href(action=>"tree", hash_base=>$hash_base,
- file_name=>$up)},
+ print $cgi->a({-href => href(action=>"tree",
+ hash_base=>$hash_base,
+ file_name=>$up,
+ extra_options=>\@extra_options)},
"..");
print "</td>\n";
print "<td class=\"link\"></td>\n";
@@ -4339,7 +4364,7 @@ sub git_tree {
print "</tr>\n";
}
foreach my $line (@entries) {
- my %t = parse_ls_tree_line($line, -z => 1);
+ my %t = parse_ls_tree_line($line, -z => 1, -l => $show_sizes);
if ($alternate) {
print "<tr class=\"dark\">\n";
--
1.5.2.4
^ permalink raw reply related
* Re: [RFC (take 2) Git User's Survey 2007
From: Jakub Narebski @ 2007-07-31 11:22 UTC (permalink / raw)
To: git; +Cc: Paolo Ciarrocchi
In-Reply-To: <200707302256.38251.jnareb@gmail.com>
I might have no access ti Internet for a while, so the survey start
might get delayed. Unless of course somebody want's to do the honors...
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: [RFC (take 2) Git User's Survey 2007
From: Paolo Ciarrocchi @ 2007-07-31 11:33 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <200707311322.43088.jnareb@gmail.com>
On 7/31/07, Jakub Narebski <jnareb@gmail.com> wrote:
> I might have no access ti Internet for a while, so the survey start
> might get delayed. Unless of course somebody want's to do the honors...
>
I might help.
Did you already choose the web survey service?
Ciao,
--
Paolo
^ permalink raw reply
* [PATCH] Add an option to specify a file to config builtin
From: Alex Riesen @ 2007-07-31 11:53 UTC (permalink / raw)
To: Git Mailing List; +Cc: Junio C Hamano
[-- Attachment #1: Type: text/plain, Size: 378 bytes --]
There are (really!) systems where using environment variables is very
cumbersome (yes, Windows, it has problems unsetting them). Besides this
form is shorter.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
Documentation/git-config.txt | 29 ++++++++++++++++-------------
builtin-config.c | 9 ++++++++-
2 files changed, 24 insertions(+), 14 deletions(-)
[-- Attachment #2: 0001-Add-an-option-to-specify-a-file-to-config-builtin.txt --]
[-- Type: text/plain, Size: 4716 bytes --]
From 787abe4b0a71856b8671a41c9b83561fde84e558 Mon Sep 17 00:00:00 2001
From: Alex Riesen <raa.lkml@gmail.com>
Date: Tue, 31 Jul 2007 11:58:43 +0200
Subject: [PATCH] Add an option to specify a file to config builtin
There are (really!) systems where using environment variables is very
cumbersome (yes, Windows, it has problems unsetting them). Besides this
form is shorter.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
Documentation/git-config.txt | 29 ++++++++++++++++-------------
builtin-config.c | 9 ++++++++-
2 files changed, 24 insertions(+), 14 deletions(-)
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
index 5f66a7f..88acf6c 100644
--- a/Documentation/git-config.txt
+++ b/Documentation/git-config.txt
@@ -9,17 +9,17 @@ git-config - Get and set repository or global options
SYNOPSIS
--------
[verse]
-'git-config' [--system | --global] [type] [-z|--null] name [value [value_regex]]
-'git-config' [--system | --global] [type] --add name value
-'git-config' [--system | --global] [type] --replace-all name [value [value_regex]]
-'git-config' [--system | --global] [type] [-z|--null] --get name [value_regex]
-'git-config' [--system | --global] [type] [-z|--null] --get-all name [value_regex]
-'git-config' [--system | --global] [type] [-z|--null] --get-regexp name_regex [value_regex]
-'git-config' [--system | --global] --unset name [value_regex]
-'git-config' [--system | --global] --unset-all name [value_regex]
-'git-config' [--system | --global] --rename-section old_name new_name
-'git-config' [--system | --global] --remove-section name
-'git-config' [--system | --global] [-z|--null] -l | --list
+'git-config' [--system | --global | [-f|--file] config-file] [type] [-z|--null] name [value [value_regex]]
+'git-config' [--system | --global | [-f|--file] config-file] [type] --add name value
+'git-config' [--system | --global | [-f|--file] config-file] [type] --replace-all name [value [value_regex]]
+'git-config' [--system | --global | [-f|--file] config-file] [type] [-z|--null] --get name [value_regex]
+'git-config' [--system | --global | [-f|--file] config-file] [type] [-z|--null] --get-all name [value_regex]
+'git-config' [--system | --global | [-f|--file] config-file] [type] [-z|--null] --get-regexp name_regex [value_regex]
+'git-config' [--system | --global | [-f|--file] config-file] --unset name [value_regex]
+'git-config' [--system | --global | [-f|--file] config-file] --unset-all name [value_regex]
+'git-config' [--system | --global | [-f|--file] config-file] --rename-section old_name new_name
+'git-config' [--system | --global | [-f|--file] config-file] --remove-section name
+'git-config' [--system | --global | [-f|--file] config-file] [-z|--null] -l | --list
DESCRIPTION
-----------
@@ -42,8 +42,8 @@ no checks or transformations are performed on the value.
This command will fail if:
-. The .git/config file is invalid,
-. Can not write to .git/config,
+. The config file is invalid,
+. Can not write to the config file,
. no section was provided,
. the section or key is invalid,
. you try to unset an option which does not exist,
@@ -93,6 +93,9 @@ rather than from all available files.
+
See also <<FILES>>.
+-f config-file, --file config-file::
+ Use the given config file instead of the one specified by GIT_CONFIG.
+
--remove-section::
Remove the given section from the configuration file.
diff --git a/builtin-config.c b/builtin-config.c
index 7d2063c..0a605e0 100644
--- a/builtin-config.c
+++ b/builtin-config.c
@@ -2,7 +2,7 @@
#include "cache.h"
static const char git_config_set_usage[] =
-"git-config [ --global | --system ] [ --bool | --int ] [ -z | --null ] [--get | --get-all | --get-regexp | --replace-all | --add | --unset | --unset-all] name [value [value_regex]] | --rename-section old_name new_name | --remove-section name | --list";
+"git-config [ --global | --system | [ -f | --file ] config-file ] [ --bool | --int ] [ -z | --null ] [--get | --get-all | --get-regexp | --replace-all | --add | --unset | --unset-all] name [value [value_regex]] | --rename-section old_name new_name | --remove-section name | --list";
static char *key;
static regex_t *key_regexp;
@@ -186,6 +186,13 @@ int cmd_config(int argc, const char **argv, const char *prefix)
}
else if (!strcmp(argv[1], "--system"))
setenv(CONFIG_ENVIRONMENT, ETC_GITCONFIG, 1);
+ else if (!strcmp(argv[1], "--file") || !strcmp(argv[1], "-f")) {
+ if (argc < 3)
+ usage(git_config_set_usage);
+ setenv(CONFIG_ENVIRONMENT, argv[2], 1);
+ argc--;
+ argv++;
+ }
else if (!strcmp(argv[1], "--null") || !strcmp(argv[1], "-z")) {
term = '\0';
delim = '\n';
--
1.5.3.rc3.132.g39179
^ permalink raw reply related
* [PATCH] Add a test for git-config --file
From: Alex Riesen @ 2007-07-31 11:53 UTC (permalink / raw)
To: Git Mailing List; +Cc: Junio C Hamano
[-- Attachment #1: Type: text/plain, Size: 256 bytes --]
Check for non-0 exit code if the confiog file does not exist and
if it works exactly like when setting GIT_CONFIG.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
t/t1300-repo-config.sh | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
[-- Attachment #2: 0002-Add-a-test-for-git-config-file.txt --]
[-- Type: text/plain, Size: 1285 bytes --]
From a5ae18f299d431053074c0ebdcf2d96a3ac9dff6 Mon Sep 17 00:00:00 2001
From: Alex Riesen <raa.lkml@gmail.com>
Date: Tue, 31 Jul 2007 12:30:52 +0200
Subject: [PATCH] Add a test for git-config --file
Check for non-0 exit code if the confiog file does not exist and
if it works exactly like when setting GIT_CONFIG.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
t/t1300-repo-config.sh | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 187ca2d..1d2bf2c 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -325,6 +325,9 @@ EOF
test_expect_success 'new variable inserts into proper section' 'cmp .git/config expect'
+test_expect_success 'alternative GIT_CONFIG (non-existing file should fail)' \
+ 'git config --file non-existing-config -l; test $? != 0'
+
cat > other-config << EOF
[ein]
bahn = strasse
@@ -338,6 +341,9 @@ GIT_CONFIG=other-config git config -l > output
test_expect_success 'alternative GIT_CONFIG' 'cmp output expect'
+test_expect_success 'alternative GIT_CONFIG (--file)' \
+ 'git config --file other-config -l > output && cmp output expect'
+
GIT_CONFIG=other-config git config anwohner.park ausweis
cat > expect << EOF
--
1.5.3.rc3.132.g39179
^ permalink raw reply related
* Re: [PATCH] Add an option to specify a file to config builtin
From: Johannes Schindelin @ 2007-07-31 11:59 UTC (permalink / raw)
To: Alex Riesen; +Cc: Git Mailing List, Junio C Hamano
In-Reply-To: <81b0412b0707310453pc6b11d2r90ca0f22b5ed601e@mail.gmail.com>
Hi,
On Tue, 31 Jul 2007, Alex Riesen wrote:
> There are (really!) systems where using environment variables is very
> cumbersome (yes, Windows, it has problems unsetting them). Besides this
> form is shorter.
You could use this chance to make the verse nicer, i.e. split it into a
[<file-option>] and an [<action>] part.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH] Add an option to specify a file to config builtin
From: Alex Riesen @ 2007-07-31 12:02 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Git Mailing List, Junio C Hamano
In-Reply-To: <Pine.LNX.4.64.0707311258340.14781@racer.site>
On 7/31/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>
> > There are (really!) systems where using environment variables is very
> > cumbersome (yes, Windows, it has problems unsetting them). Besides this
> > form is shorter.
>
> You could use this chance to make the verse nicer, i.e. split it into a
> [<file-option>] and an [<action>] part.
Missed that opportunity for today, I'm afraid. Will try to get to it
the next evening
^ permalink raw reply
* Re: Git error on Cygwin
From: Claudio Scordino @ 2007-07-31 12:29 UTC (permalink / raw)
To: Alex Riesen; +Cc: git
In-Reply-To: <81b0412b0707310051n4e62257bt279f65d159757876@mail.gmail.com>
Alex Riesen wrote:
> On 7/30/07, Claudio Scordino <cloud.of.andor@gmail.com> wrote:
>> Hi all,
>>
>> I just installed cygwin on Windows XP and I have the following error when
>> using git-clone.
>>
>> (Consider that the same command on the same repository works on Linux).
>
> Definitely.
>
>> $ git-clone <username>@<host>:/<path>/<project>
>> Initialized empty Git repository in /home/Claudio/<project>/.git/
>> <username>@<host>'s password:
>> remote: Generating pack...
>> remote: Done counting 30387 objects.
>> remote: Deltifying 30387 objects...
>> remote: 100% (30387/30387) done
>> Indexing 30387 objects...
>> remote: Total 30387 (delta 4446), reused 30188 (delta 4351)
>> 100% (30387/30387) done
>> Resolving 4446 deltas...
>> 100% (4446/4446) done
>> 3 [main] git-read-tree 2160 C:\cygwin\bin\git-read-tree.exe: *** fatal
>> error - could not load shell32, Win32 error 487
>> /usr/bin/git-clone: line 404: 2160 Hangup git-read-tree -m -u
>> $v HEAD HEAD
>
> Report this to cygwin team.
Done. :)
> Try rerunning the command, usually
> it helps (typical workaround for cygwin).
Unfortunately it does not.
Hopefully someone from the cygwin team will help me.
Many thanks,
Claudio
^ permalink raw reply
* Re: [RFC (take 2) Git User's Survey 2007
From: Jakub Narebski @ 2007-07-31 12:30 UTC (permalink / raw)
To: Paolo Ciarrocchi; +Cc: git
In-Reply-To: <4d8e3fd30707310433m24f5fc89hd2053cafbfac7cd8@mail.gmail.com>
On 7/31/07, Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> wrote:
> On 7/31/07, Jakub Narebski <jnareb@gmail.com> wrote:
> > I might have no access ti Internet for a while, so the survey start
> > might get delayed. Unless of course somebody want's to do the honors...
> >
>
> I might help.
> Did you already choose the web survey service?
No. I was thinking about using the same as in previous survey.
P.S. One thing that remains is removing egit from the list
of answers for porcelains.
--
Jakub Narebski
^ permalink raw reply
* [PATCH 1/4] Fix allocation of "int*" instead of "int".
From: Christian Couder @ 2007-07-31 12:48 UTC (permalink / raw)
To: Junio Hamano; +Cc: git
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
While working on something like a "git bisect dunno", I came up with
the patches in this series.
Thanks in advance,
Christian.
builtin-rev-list.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/builtin-rev-list.c b/builtin-rev-list.c
index 8efd609..5bcafe4 100644
--- a/builtin-rev-list.c
+++ b/builtin-rev-list.c
@@ -300,7 +300,7 @@ static struct commit_list *find_bisection(struct commit_list *list,
show_list("bisection 2 sorted", 0, nr, list);
*all = nr;
- weights = xcalloc(on_list, sizeof(int*));
+ weights = xcalloc(on_list, sizeof(int));
counted = 0;
for (n = 0, p = list; p; p = p->next) {
--
1.5.2.1.144.gabc40
^ permalink raw reply related
* [PATCH 2/4] Move finding bisection into do_find_bisection.
From: Christian Couder @ 2007-07-31 12:48 UTC (permalink / raw)
To: Junio Hamano; +Cc: git
In-Reply-To: <20070731143602.a5ed0a04.chriscool@tuxfamily.org>
This factorises some code and make a big function smaller.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
builtin-rev-list.c | 40 +++++++++++++++++++++++++---------------
1 files changed, 25 insertions(+), 15 deletions(-)
diff --git a/builtin-rev-list.c b/builtin-rev-list.c
index 5bcafe4..4e2524a 100644
--- a/builtin-rev-list.c
+++ b/builtin-rev-list.c
@@ -255,6 +255,9 @@ static void show_list(const char *debug, int counted, int nr,
}
#endif /* DEBUG_BISECT */
+static struct commit_list *do_find_bisection(struct commit_list *list,
+ int nr, int *weights);
+
/*
* zero or positive weight is the number of interesting commits it can
* reach, including itself. Especially, weight = 0 means it does not
@@ -272,7 +275,7 @@ static void show_list(const char *debug, int counted, int nr,
static struct commit_list *find_bisection(struct commit_list *list,
int *reaches, int *all)
{
- int n, nr, on_list, counted, distance;
+ int nr, on_list;
struct commit_list *p, *best, *next, *last;
int *weights;
@@ -301,6 +304,25 @@ static struct commit_list *find_bisection(struct commit_list *list,
*all = nr;
weights = xcalloc(on_list, sizeof(int));
+
+ /* Do the real work of finding bisection commit. */
+ best = do_find_bisection(list, nr, weights);
+
+ if (best)
+ best->next = NULL;
+
+ *reaches = weight(best);
+ free(weights);
+
+ return best;
+}
+
+static struct commit_list *do_find_bisection(struct commit_list *list,
+ int nr, int *weights)
+{
+ int n, counted, distance;
+ struct commit_list *p, *best;
+
counted = 0;
for (n = 0, p = list; p; p = p->next) {
@@ -357,12 +379,8 @@ static struct commit_list *find_bisection(struct commit_list *list,
weight_set(p, distance);
/* Does it happen to be at exactly half-way? */
- if (halfway(p, distance, nr)) {
- p->next = NULL;
- *reaches = distance;
- free(weights);
+ if (halfway(p, distance, nr))
return p;
- }
counted++;
}
@@ -400,12 +418,8 @@ static struct commit_list *find_bisection(struct commit_list *list,
/* Does it happen to be at exactly half-way? */
distance = weight(p);
- if (halfway(p, distance, nr)) {
- p->next = NULL;
- *reaches = distance;
- free(weights);
+ if (halfway(p, distance, nr))
return p;
- }
}
}
@@ -425,12 +439,8 @@ static struct commit_list *find_bisection(struct commit_list *list,
if (distance > counted) {
best = p;
counted = distance;
- *reaches = weight(p);
}
}
- if (best)
- best->next = NULL;
- free(weights);
return best;
}
--
1.5.2.1.144.gabc40
^ permalink raw reply related
* [PATCH 3/4] Move some bisection code into best_bisection.
From: Christian Couder @ 2007-07-31 12:48 UTC (permalink / raw)
To: Junio Hamano; +Cc: git
In-Reply-To: <20070731143602.a5ed0a04.chriscool@tuxfamily.org>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
builtin-rev-list.c | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/builtin-rev-list.c b/builtin-rev-list.c
index 4e2524a..e5e8011 100644
--- a/builtin-rev-list.c
+++ b/builtin-rev-list.c
@@ -258,6 +258,8 @@ static void show_list(const char *debug, int counted, int nr,
static struct commit_list *do_find_bisection(struct commit_list *list,
int nr, int *weights);
+static struct commit_list *best_bisection(struct commit_list *list, int nr);
+
/*
* zero or positive weight is the number of interesting commits it can
* reach, including itself. Especially, weight = 0 means it does not
@@ -321,7 +323,7 @@ static struct commit_list *do_find_bisection(struct commit_list *list,
int nr, int *weights)
{
int n, counted, distance;
- struct commit_list *p, *best;
+ struct commit_list *p;
counted = 0;
@@ -426,9 +428,17 @@ static struct commit_list *do_find_bisection(struct commit_list *list,
show_list("bisection 2 counted all", counted, nr, list);
/* Then find the best one */
- counted = -1;
+ return best_bisection(list, nr);
+}
+
+static struct commit_list *best_bisection(struct commit_list *list, int nr)
+{
+ struct commit_list *p, *best;
+ int best_distance = -1;
+
best = list;
for (p = list; p; p = p->next) {
+ int distance;
unsigned flags = p->item->object.flags;
if (revs.prune_fn && !(flags & TREECHANGE))
@@ -436,11 +446,12 @@ static struct commit_list *do_find_bisection(struct commit_list *list,
distance = weight(p);
if (nr - distance < distance)
distance = nr - distance;
- if (distance > counted) {
+ if (distance > best_distance) {
best = p;
- counted = distance;
+ best_distance = distance;
}
}
+
return best;
}
--
1.5.2.1.144.gabc40
^ permalink raw reply related
* [PATCH 4/4] Bisection "distance" clean up.
From: Christian Couder @ 2007-07-31 12:48 UTC (permalink / raw)
To: Junio Hamano; +Cc: git
In-Reply-To: <20070731143602.a5ed0a04.chriscool@tuxfamily.org>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
builtin-rev-list.c | 18 +++++++-----------
1 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/builtin-rev-list.c b/builtin-rev-list.c
index e5e8011..38d7069 100644
--- a/builtin-rev-list.c
+++ b/builtin-rev-list.c
@@ -189,7 +189,7 @@ static int count_interesting_parents(struct commit *commit)
return count;
}
-static inline int halfway(struct commit_list *p, int distance, int nr)
+static inline int halfway(struct commit_list *p, int nr)
{
/*
* Don't short-cut something we are not going to return!
@@ -202,8 +202,7 @@ static inline int halfway(struct commit_list *p, int distance, int nr)
* 2 and 3 are halfway of 5.
* 3 is halfway of 6 but 2 and 4 are not.
*/
- distance *= 2;
- switch (distance - nr) {
+ switch (2 * weight(p) - nr) {
case -1: case 0: case 1:
return 1;
default:
@@ -322,7 +321,7 @@ static struct commit_list *find_bisection(struct commit_list *list,
static struct commit_list *do_find_bisection(struct commit_list *list,
int nr, int *weights)
{
- int n, counted, distance;
+ int n, counted;
struct commit_list *p;
counted = 0;
@@ -373,15 +372,13 @@ static struct commit_list *do_find_bisection(struct commit_list *list,
for (p = list; p; p = p->next) {
if (p->item->object.flags & UNINTERESTING)
continue;
- n = weight(p);
- if (n != -2)
+ if (weight(p) != -2)
continue;
- distance = count_distance(p);
+ weight_set(p, count_distance(p));
clear_distance(list);
- weight_set(p, distance);
/* Does it happen to be at exactly half-way? */
- if (halfway(p, distance, nr))
+ if (halfway(p, nr))
return p;
counted++;
}
@@ -419,8 +416,7 @@ static struct commit_list *do_find_bisection(struct commit_list *list,
weight_set(p, weight(q));
/* Does it happen to be at exactly half-way? */
- distance = weight(p);
- if (halfway(p, distance, nr))
+ if (halfway(p, nr))
return p;
}
}
--
1.5.2.1.144.gabc40
^ permalink raw reply related
* Re: git-svn and distributed git
From: Väinö Järvelä @ 2007-07-31 12:31 UTC (permalink / raw)
To: git
In-Reply-To: <65B05BC3-2BC2-4451-87C2-940113C55287@pp.inet.fi>
On Jul 31, 2007, at 12:42, Väinö Järvelä wrote:
> I have thought about using two branches on the server, master,
> which will only include commits already processed through git-svn,
> and dev, which is used to pull the "local" changes to be committed
> to Subversion. But my inexperience with git got me here, and I
> can't seem to be able to get any updates from the other branch. And
> I'm not even sure if this is the right approach to this problem.
I got the branched situation to work. I was just pushing and pulling
wrong when it didn't work. I guess I didn't understand the
documentation well enough to fiddle around with remotes.
I got the branching to work with simple commands:
server$ git push origin dev
laptop$ git pull server dev
laptop$ git-svn dcommit && git push server && git branch -r -d dev
server$ git checkout master && git pull origin && git branch -D dev
But that's a lot of commands, am I still missing something with the
branching?
Regards,
Väinö
^ 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