* Author name and e-mail address in .stgitrc
From: Karl Hasselström @ 2006-11-11 14:15 UTC (permalink / raw)
To: Catalin Marinas; +Cc: git
In-Reply-To: <20061111113553.GA11224@diana.vm.bytemark.co.uk>
Is there any particular reason to have the author and committer names
in ~/.stgitrc? Simply taking them from the same place git does would
probably be a usability enhancement (unless they're specified on the
command line, of course).
--
Karl Hasselström, kha@treskal.com
^ permalink raw reply
* Re: Shallow clone
From: Alexandre Julliard @ 2006-11-11 13:57 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Aneesh Kumar K.V, git
In-Reply-To: <7vac31p8om.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
> But it seems to need some more work. I just tried to clone
> git.git with --depth=1 and it cauterizes each branch with two
> commits (I think that is what depth=1 means -- the latest and
> one behind it), but it pulled almost the whole repository
> anyway, and it turns out that "git log v1.4.3-rc1" gives me the
> full history leading to it.
That's apparently because tags are not considered when truncating the
commit list. The patch below fixes it, and fetches the right number of
commits for each tag. However the correct fix is probably to not fetch
historical tags at all.
There's also a problem with the packing, a clone --depth 1 currently
results in a pack that's about 3 times as large as it should be.
---
diff --git a/shallow.c b/shallow.c
index 58a7b20..2db1dc4 100644
--- a/shallow.c
+++ b/shallow.c
@@ -1,5 +1,6 @@
#include "cache.h"
#include "commit.h"
+#include "tag.h"
static int is_shallow = -1;
@@ -54,7 +55,7 @@ struct commit_list *get_shallow_commits(
if (!commit) {
if (i < heads->nr) {
commit = (struct commit *)
- heads->objects[i++].item;
+ deref_tag(heads->objects[i++].item, NULL, 0);
if (commit->object.type != OBJ_COMMIT) {
commit = NULL;
continue;
--
Alexandre Julliard
^ permalink raw reply related
* Re: StGIT repository not clonable?
From: Karl Hasselström @ 2006-11-11 12:36 UTC (permalink / raw)
To: Horst H. von Brand; +Cc: catalin.marinas, git
In-Reply-To: <200611110359.kAB3ul02013227@laptop13.inf.utfsm.cl>
On 2006-11-11 00:56:47 -0300, Horst H. von Brand wrote:
> I'm trying to update my StGIT repo here, and get a crash from
> git-http-fetch (git 1.4.3.4). Trying to clone it anew gives:
>
> [vonbrand@laptop13 tmp]$ git-clone http://homepage.ntlworld.com/cmarinas/stgit.git
> error: Unable to start request
> error: Could not interpret heads/master as something to pull
>
> What am I doing wrong?
It works for me, with
$ git --version
git version 1.4.3.3.g8387
But it's horribly slow. Catalin, have you ever packed that repository?
--
Karl Hasselström, kha@treskal.com
^ permalink raw reply
* [PATCH] Add file addition/deletion indicator in diffstat
From: pclouds @ 2006-11-11 12:33 UTC (permalink / raw)
To: git
For new files, " (new)" will be appended to filenames.
For deleted files, " (deleted)" will be appended to filenames.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
diff.c | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/diff.c b/diff.c
index 3315378..bd78138 100644
--- a/diff.c
+++ b/diff.c
@@ -599,6 +599,8 @@ struct diffstat_t {
unsigned is_unmerged:1;
unsigned is_binary:1;
unsigned is_renamed:1;
+ unsigned is_added:1;
+ unsigned is_deleted:1;
unsigned int added, deleted;
} **files;
};
@@ -707,6 +709,10 @@ static void show_stats(struct diffstat_t
}
len = strlen(file->name);
+ if (file->is_added)
+ len += 6; /* " (new)" */
+ if (file->is_deleted)
+ len += 10; /* " (deleted)" */
if (max_len < len)
max_len = len;
@@ -735,12 +741,25 @@ static void show_stats(struct diffstat_t
int added = data->files[i]->added;
int deleted = data->files[i]->deleted;
int name_len;
+ char *new_name = NULL;
/*
* "scale" the filename
*/
len = name_width;
name_len = strlen(name);
+ if (data->files[i]->is_added) {
+ new_name = name = xmalloc(name_len+7); /* " (new)" */
+ memcpy(name,data->files[i]->name,name_len);
+ memcpy(name+name_len," (new)",7);
+ name_len += 6;
+ }
+ if (data->files[i]->is_deleted) {
+ new_name = name = xmalloc(name_len+11); /* " (deleted)" */
+ memcpy(name,data->files[i]->name,name_len);
+ memcpy(name+name_len," (deleted)",11);
+ name_len += 10; /* " (deleted)" */
+ }
if (name_width < name_len) {
char *slash;
prefix = "...";
@@ -787,6 +806,8 @@ static void show_stats(struct diffstat_t
show_graph('-', del, del_c, reset);
putchar('\n');
free_diffstat_file:
+ if (new_name)
+ free(new_name);
free(data->files[i]->name);
free(data->files[i]);
}
@@ -1067,6 +1088,14 @@ static void builtin_diffstat(const char
data->is_unmerged = 1;
return;
}
+ if (DIFF_FILE_VALID(one)) {
+ if (!DIFF_FILE_VALID(two))
+ data->is_deleted = 1;
+ }
+ else {
+ if (DIFF_FILE_VALID(two))
+ data->is_added = 1;
+ }
if (complete_rewrite) {
diff_populate_filespec(one, 0);
diff_populate_filespec(two, 0);
--
^ permalink raw reply related
* StGIT repository not clonable?
From: Horst H. von Brand @ 2006-11-11 3:56 UTC (permalink / raw)
To: catalin.marinas; +Cc: git
I'm trying to update my StGIT repo here, and get a crash from
git-http-fetch (git 1.4.3.4). Trying to clone it anew gives:
[vonbrand@laptop13 tmp]$ git-clone http://homepage.ntlworld.com/cmarinas/stgit.git
error: Unable to start request
error: Could not interpret heads/master as something to pull
What am I doing wrong?
--
Dr. Horst H. von Brand User #22616 counter.li.org
Departamento de Informatica Fono: +56 32 2654431
Universidad Tecnica Federico Santa Maria +56 32 2654239
^ permalink raw reply
* Re: [PATCH] Add a MIME-Version header to e-mails
From: Karl Hasselström @ 2006-11-11 12:24 UTC (permalink / raw)
To: Catalin Marinas; +Cc: git
In-Reply-To: <b0943d9e0611071109w584f4f7fv3ba1b7dbd9413717@mail.gmail.com>
On 2006-11-07 19:09:06 +0000, Catalin Marinas wrote:
> I re-implemented parts of the mail and import commands (inspiring
> from your patches). They now use the email Python package. The mail
> command encodes the body to 7 or 8bit depending on non-ascii
> characters. The headers are QP-encoded. The import command can
> decode messages properly and can also handle multipart e-mails.
>
> I still have to write a test script but my simple tests showed that
> it works. Please let me know if there is anything wrong (especially
> with the QP-encoding of the mail headers).
One potentially hazardous thing: you encode the mail before letting
the user edit it (with the -e and -E switches). This means that the
user can insert non-ascii characters in the body after you've already
decided it's safe to use 7bit encoding. It also means that the user
must be careful to rfc2047-encode any changes to the Subject: and
From: headers.
--
Karl Hasselström, kha@treskal.com
^ permalink raw reply
* [PATCH] Print progress message to stderr, not stdout
From: Karl Hasselström @ 2006-11-11 12:16 UTC (permalink / raw)
To: Catalin Marinas; +Cc: git
Printing progress messages to stdout causes them to get mixed up with
the actual output of the program. Using stderr is much better, since
the user can then redirect the two components separately.
Signed-off-by: Karl Hasselström <kha@treskal.com>
---
I noticed this when creating a patch with "stg export -s" for the
import regression test.
stgit/git.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/stgit/git.py b/stgit/git.py
index 2a6ae91..8d88769 100644
--- a/stgit/git.py
+++ b/stgit/git.py
@@ -186,8 +186,8 @@ def __tree_status(files = None, tree_id
"""Returns a list of pairs - [status, filename]
"""
if verbose:
- print 'Checking for changes in the working directory...',
- sys.stdout.flush()
+ sys.stderr.write('Checking for changes in the working directory...')
+ sys.stderr.flush()
refresh_index()
@@ -226,7 +226,7 @@ def __tree_status(files = None, tree_id
cache_files.append(fs)
if verbose:
- print 'done'
+ print >> sys.stderr, 'done'
return cache_files
^ permalink raw reply related
* Re: check if a commit is ascendent of a specific commit
From: Karl Hasselström @ 2006-11-11 12:12 UTC (permalink / raw)
To: Jakub Narebski; +Cc: Nguyen Thai Ngoc Duy, git
In-Reply-To: <200611111256.20157.jnareb@gmail.com>
On 2006-11-11 12:56:19 +0100, Jakub Narebski wrote:
> Dnia sobota 11. listopada 2006 12:31, Nguyen Thai Ngoc Duy napisa??:
>
> > Yes. That's what I want. I am tempted to edit older commits just
> > because I forgot to add some entries to .gitignore that I should
> > have added sooner :-)
>
> In pure git you would have to create new branch at the commit you
> want to amend, amend the commit (in this branch), and rebase (or
> cherry-pick if you need to edit other commits too) the rest, then
> rename branch. Or if you don't want ot loose reflog, tag/branch
> current branch, then reset (rewind) current branch to the commit you
> want to amend, then cherry-pick.
>
> Or you can use cg-admin-rewritehist tool from Cogito.
In case the history you want to edit is linear (that is, merge-free),
StGIT is an excellent tool. It is very easy to go back to a previous
commit (stg pop), amend it (stg refresh), and replay the following
commits on top of the amended commit (stg push).
--
Karl Hasselström, kha@treskal.com
^ permalink raw reply
* Re: check if a commit is ascendent of a specific commit
From: Jakub Narebski @ 2006-11-11 11:56 UTC (permalink / raw)
To: Nguyen Thai Ngoc Duy; +Cc: git
In-Reply-To: <fcaeb9bf0611110331q53522c50sda399d4a7916636d@mail.gmail.com>
Dnia sobota 11. listopada 2006 12:31, Nguyen Thai Ngoc Duy napisał:
> On 11/11/06, Jakub Narebski <jnareb@gmail.com> wrote:
>> You can only amend topmost commit in any branch. Anything else would
>> be rewriting history, starting from amended commit upwards in lineage
>> (parentage).
>
> Yes. That's what I want. I am tempted to edit older commits just
> because I forgot to add some entries to .gitignore that I should have
> added sooner :-)
In pure git you would have to create new branch at the commit you want
to amend, amend the commit (in this branch), and rebase (or cherry-pick
if you need to edit other commits too) the rest, then rename branch.
Or if you don't want ot loose reflog, tag/branch current branch, then reset
(rewind) current branch to the commit you want to amend, then cherry-pick.
Or you can use cg-admin-rewritehist tool from Cogito.
See: http://git.or.cz/gitwiki/GitTips
--
Jakub Narebski
^ permalink raw reply
* Double From:s in StGIT's patch email template
From: Karl Hasselström @ 2006-11-11 11:35 UTC (permalink / raw)
To: Catalin Marinas; +Cc: git
StGIT's default patch email template has both "From: %(maintainer)s"
in the e-mail header, and "From: %(authname)s <%(authemail)s>" in the
e-mail body. Why?
--
Karl Hasselström, kha@treskal.com
^ permalink raw reply
* Re: check if a commit is ascendent of a specific commit
From: Nguyen Thai Ngoc Duy @ 2006-11-11 11:19 UTC (permalink / raw)
To: git
In-Reply-To: <fcaeb9bf0611110308l577d70bfo5046d7d7eb09ac58@mail.gmail.com>
On 11/11/06, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
> Hi,
> I want to create "git-amend-commit" to be able to amend commits before
> HEAD. So I need to check whether the commit I'm going to amend is
> ascendent of HEAD. Is there any way to check that?
Forget it. It's git-merge-base. Sorry for the noise
--
^ permalink raw reply
* Re: check if a commit is ascendent of a specific commit
From: Jakub Narebski @ 2006-11-11 11:15 UTC (permalink / raw)
To: git
In-Reply-To: <fcaeb9bf0611110308l577d70bfo5046d7d7eb09ac58@mail.gmail.com>
Nguyen Thai Ngoc Duy wrote:
> Hi,
> I want to create "git-amend-commit" to be able to amend commits before
> HEAD. So I need to check whether the commit I'm going to amend is
> ascendent of HEAD. Is there any way to check that?
You can only amend topmost commit in any branch. Anything else would
be rewriting history, starting from amended commit upwards in lineage
(parentage).
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* check if a commit is ascendent of a specific commit
From: Nguyen Thai Ngoc Duy @ 2006-11-11 11:08 UTC (permalink / raw)
To: git
Hi,
I want to create "git-amend-commit" to be able to amend commits before
HEAD. So I need to check whether the commit I'm going to amend is
ascendent of HEAD. Is there any way to check that?
--
^ permalink raw reply
* [ANNOUNCE] qgit-1.5.3
From: Marco Costalba @ 2006-11-11 8:06 UTC (permalink / raw)
To: Git Mailing List, linux-kernel
qgit it's a graphical git repositories viewer built on Qt libraries.
This is mostly a bug fix release.
Several issues has been fixed, also some crash bugs, so an update is
strongly suggested.
To note is the new possibility to set the font used by patch and file
content viewers.
Thanks to Pavel Roskin and Josef Weidendorfer for their help and patches.
Download tarball from http://www.sourceforge.net/projects/qgit
or directly from git public repository
git://git.kernel.org/pub/scm/qgit/qgit.git
Please refer to http://digilander.libero.it/mcostalba/ for additional
information.
Marco
ChangeLog from 1.5.2
- use a smaller tab close button and a smaller icon (Pavel Roskin)
- fix a crash in case of repo change while in filtered view
- fix a crash due to evil static pointers
- clear all the panes if search from the toolbar doesn't find anything
- silence a Qt warning when closing a tab
- let the user to set the typewriter (fixed width) font used
with patch and file content viewers
- fix broken StGit 'pop' command interface
- do not use "--keep" option of git-am as default
- fix issues with tag marks when changing graph size
- fix filenames cache data saving in case of bare repositories
- rewrite and simplify graph drawing code (Josef Weidendorfer)
- fix issues with file names with spaces
- adjust columns width when changing window size
- fetch file history from all trees instead of only current
- early exit update cycle when a new request arrives
- correctly order tags in start-up input range dialog
^ permalink raw reply
* Re: Non-ASCII paths and git-cvsserver
From: Junio C Hamano @ 2006-11-10 19:49 UTC (permalink / raw)
To: sf; +Cc: git, Martin Langhoff
In-Reply-To: <45530CEE.6030008@b-i-t.de>
sf <sf@b-i-t.de> writes:
> I want to access a git repository via git-cvsserver. The problem is
> that the repository contains paths with umlauts. These paths come out
> quoted and escaped when checked out with cvs.
I think this is because the cvsserver invokes diff-tree and
ls-tree without -z and the output from these command quote
non-ascii letters as unsafe.
Martin's sqlite may probably be needed as well, but regardless
of that something like this patch is needed -- otherwise what
populates sqlite database will be quoted to begin with so it
would not help much.
I've tested with your reproduction recipe, but otherwise not
tested this patch.
-- >8 --
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 8817f8b..ca519b7 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -2343,67 +2343,72 @@ sub update
if ( defined ( $lastpicked ) )
{
- my $filepipe = open(FILELIST, '-|', 'git-diff-tree', '-r', $lastpicked, $commit->{hash}) or die("Cannot call git-diff-tree : $!");
+ my $filepipe = open(FILELIST, '-|', 'git-diff-tree', '-z', '-r', $lastpicked, $commit->{hash}) or die("Cannot call git-diff-tree : $!");
+ local ($/) = "\0";
while ( <FILELIST> )
{
- unless ( /^:\d{6}\s+\d{3}(\d)\d{2}\s+[a-zA-Z0-9]{40}\s+([a-zA-Z0-9]{40})\s+(\w)\s+(.*)$/o )
+ chomp;
+ unless ( /^:\d{6}\s+\d{3}(\d)\d{2}\s+[a-zA-Z0-9]{40}\s+([a-zA-Z0-9]{40})\s+(\w)$/o )
{
die("Couldn't process git-diff-tree line : $_");
}
+ my ($mode, $hash, $change) = ($1, $2, $3);
+ my $name = <FILELIST>;
+ chomp($name);
- # $log->debug("File mode=$1, hash=$2, change=$3, name=$4");
+ # $log->debug("File mode=$mode, hash=$hash, change=$change, name=$name");
my $git_perms = "";
- $git_perms .= "r" if ( $1 & 4 );
- $git_perms .= "w" if ( $1 & 2 );
- $git_perms .= "x" if ( $1 & 1 );
+ $git_perms .= "r" if ( $mode & 4 );
+ $git_perms .= "w" if ( $mode & 2 );
+ $git_perms .= "x" if ( $mode & 1 );
$git_perms = "rw" if ( $git_perms eq "" );
- if ( $3 eq "D" )
+ if ( $change eq "D" )
{
- #$log->debug("DELETE $4");
- $head->{$4} = {
- name => $4,
- revision => $head->{$4}{revision} + 1,
+ #$log->debug("DELETE $name");
+ $head->{$name} = {
+ name => $name,
+ revision => $head->{$name}{revision} + 1,
filehash => "deleted",
commithash => $commit->{hash},
modified => $commit->{date},
author => $commit->{author},
mode => $git_perms,
};
- $self->insert_rev($4, $head->{$4}{revision}, $2, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
+ $self->insert_rev($name, $head->{$name}{revision}, $hash, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
}
- elsif ( $3 eq "M" )
+ elsif ( $change eq "M" )
{
- #$log->debug("MODIFIED $4");
- $head->{$4} = {
- name => $4,
- revision => $head->{$4}{revision} + 1,
- filehash => $2,
+ #$log->debug("MODIFIED $name");
+ $head->{$name} = {
+ name => $name,
+ revision => $head->{$name}{revision} + 1,
+ filehash => $hash,
commithash => $commit->{hash},
modified => $commit->{date},
author => $commit->{author},
mode => $git_perms,
};
- $self->insert_rev($4, $head->{$4}{revision}, $2, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
+ $self->insert_rev($name, $head->{$name}{revision}, $hash, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
}
- elsif ( $3 eq "A" )
+ elsif ( $change eq "A" )
{
- #$log->debug("ADDED $4");
- $head->{$4} = {
- name => $4,
+ #$log->debug("ADDED $name");
+ $head->{$name} = {
+ name => $name,
revision => 1,
- filehash => $2,
+ filehash => $hash,
commithash => $commit->{hash},
modified => $commit->{date},
author => $commit->{author},
mode => $git_perms,
};
- $self->insert_rev($4, $head->{$4}{revision}, $2, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
+ $self->insert_rev($name, $head->{$name}{revision}, $hash, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
}
else
{
- $log->warn("UNKNOWN FILE CHANGE mode=$1, hash=$2, change=$3, name=$4");
+ $log->warn("UNKNOWN FILE CHANGE mode=$mode, hash=$hash, change=$change, name=$name");
die;
}
}
@@ -2412,10 +2417,12 @@ sub update
# this is used to detect files removed from the repo
my $seen_files = {};
- my $filepipe = open(FILELIST, '-|', 'git-ls-tree', '-r', $commit->{hash}) or die("Cannot call git-ls-tree : $!");
+ my $filepipe = open(FILELIST, '-|', 'git-ls-tree', '-z', '-r', $commit->{hash}) or die("Cannot call git-ls-tree : $!");
+ local $/ = "\0";
while ( <FILELIST> )
{
- unless ( /^(\d+)\s+(\w+)\s+([a-zA-Z0-9]+)\s+(.*)$/o )
+ chomp;
+ unless ( /^(\d+)\s+(\w+)\s+([a-zA-Z0-9]+)\t(.*)$/o )
{
die("Couldn't process git-ls-tree line : $_");
}
^ permalink raw reply related
* Re: Non-ASCII paths and git-cvsserver
From: Martin Langhoff @ 2006-11-10 18:59 UTC (permalink / raw)
To: sf; +Cc: git
In-Reply-To: <45530CEE.6030008@b-i-t.de>
On 11/9/06, sf <sf@b-i-t.de> wrote:
> I want to access a git repository via git-cvsserver. The problem is that
> the repository contains paths with umlauts. These paths come out quoted
> and escaped when checked out with cvs.
Thanks for the detailed report! I am travelling right now, so with
"high latency" and on a machine that's missing sqlite libs :-/
But I'll give it a go anyway.
Does this mini-patch help? You'll need Perl 5.8.x and probably a
recent SQLite for this.
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 8817f8b..c534de5 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -22,6 +22,9 @@ use Fcntl;
use File::Temp qw/tempdir tempfile/;
use File::Basename;
+binmode(STDIN, ':utf8');
+binmode(STDOUT, ':utf8');
+
my $log = GITCVS::log->new();
my $cfg;
@@ -2104,6 +2107,11 @@ sub new
$self->{tables}{$table} = 1;
}
+ # this will set the encoding for new DBs
+ # or return false for existing DBs that are not
+ # utf-8
+ $self->{dbh}->do('PRAGMA encoding = "UTF-8"');
+
# Construct the revision table if required
unless ( $self->{tables}{revision} )
^ permalink raw reply related
* Re: [PATCH] gitweb: protect blob and diff output lines from controls.
From: Luben Tuikov @ 2006-11-10 10:22 UTC (permalink / raw)
To: Junio C Hamano, Jakub Narebski; +Cc: git, Petr Baudis, Luben Tuikov
In-Reply-To: <7vlkmlkkq8.fsf@assigned-by-dhcp.cox.net>
--- Junio C Hamano <junkio@cox.net> wrote:
> Jakub Narebski <jnareb@gmail.com> writes:
>
> > Jakub Narebski wrote:
> >> I'm not sure what quoting to choose for esc_attr, but there we could
> >> use even --no-control-chars quoting (replacing any control character
> >> by '?'); but perhaps in some cases like git_print_page_path
> >> subroutine CEC is better.
>
> To be honest, I do not have strong preference between the
> escaping style. If the gitweb cabal feel it is more natural to
> see "^L" in blobs and "\f" in path, I will very happily accept
> such a patch.
I've little preference either, as long as the intention
of the original name is preserved across gitweb (to a user's
git-repo/download).
> Yes. It is unfortunate that there needs different types of
> quoting. I think the first step would be to stop calling
> esc_html in esc_path. I think it was a mistake, and I did not
> correct it when I started touching it.
When Jakub mentioned "to_qtext" he meant this patch:
http://marc.theaimsgroup.com/?l=git&m=116016249121781&w=2
Luben
> Somehow I ended up spending sizeable part of my git day this
> week on fixing up blob/blame/tag/commit message view regarding
> this "make controls visible and safe" issues on the 'master'
> branch, but I have been consciously staying out of gitweb/ part
> of the system, primarily because there are many other people who
> are more interested and qualified in it than myself.
>
> I'll step aside and try not to get in the way. There is another
> thing I noticed while testing it with an artifitial test that I
> haven't fixed, but I think you already know about it (when the
> commitdiff is completely empty except mode changes, we end up
> with unbalanced div). My test's tip can be found at
> 'gitweb-test-funny-char' branch temporarily in the git.git
> repository.
>
> -
> 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
* [PATCH] FIX git pull failure with shallow clone changes
From: Aneesh Kumar K.V @ 2006-11-10 6:27 UTC (permalink / raw)
To: Aneesh Kumar K.V, git
In-Reply-To: <45541503.4020604@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: 0001-I-was-using-the-pu-branch-i-tried-to-update-the-git-repository-and-i.txt --]
[-- Type: text/plain, Size: 1470 bytes --]
I was using the pu branch i tried to update the git repository and i
got this error.
walk 9e950efa20dc8037c27509666cba6999da9368e8
walk 3b6a792f6ace33584897d1af08630c9acc0ce221
* refs/heads/origin: fast forward to branch 'master' of
http://repo.or.cz/r/linux-2.6
old..new: 3d42488..088406b
Auto-following refs/tags/v2.6.19-rc5
shallow clone with http not supported
This repository was not cloned with -depth. I only updated the git
tools using the pu branch
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com>
---
git-fetch.sh | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/git-fetch.sh b/git-fetch.sh
index 8b46e73..14ba4b2 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -314,9 +314,9 @@ fetch_main () {
noepsv_opt="--disable-epsv"
fi
max_depth=5
- depth=0
+ cur_depth=0
head="ref: $remote_name"
- while (expr "z$head" : "zref:" && expr $depth \< $max_depth) >/dev/null
+ while (expr "z$head" : "zref:" && expr $cur_depth \< $max_depth) >/dev/null
do
remote_name_quoted=$(@@PERL@@ -e '
my $u = $ARGV[0];
@@ -325,7 +325,7 @@ fetch_main () {
print "$u";
' "$head")
head=$(curl -nsfL $curl_extra_args $noepsv_opt "$remote/$remote_name_quoted")
- depth=$( expr \( $depth + 1 \) )
+ cur_depth=$( expr \( $cur_depth + 1 \) )
done
expr "z$head" : "z$_x40\$" >/dev/null ||
die "Failed to fetch $remote_name from $remote"
--
1.4.4.rc1.g368c-dirty
^ permalink raw reply related
* Re: shallow clone failed git pull
From: Aneesh Kumar K.V @ 2006-11-10 5:58 UTC (permalink / raw)
To: Aneesh Kumar K.V, git
In-Reply-To: <4552A865.5000201@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 682 bytes --]
Aneesh Kumar K.V wrote:
> I was using the pu branch i tried to update the git repository and i got
> this error.
>
> alk 9e950efa20dc8037c27509666cba6999da9368e8
> walk 3b6a792f6ace33584897d1af08630c9acc0ce221
> * refs/heads/origin: fast forward to branch 'master' of
> http://repo.or.cz/r/linux-2.6
> old..new: 3d42488..088406b
> Auto-following refs/tags/v2.6.19-rc5
> shallow clone with http not supported
>
>
> This repository was not cloned with -depth. I only updated the git tools
> using the pu branch
>
The attached patch gets it working. I am not sure whether the fix is the right one. I
am a little bit confused regarding the $depth being incremented.
-aneesh
[-- Attachment #2: git-fetch.sh.diff --]
[-- Type: text/x-patch, Size: 1402 bytes --]
diff --git a/git-fetch.sh b/git-fetch.sh
index 8b46e73..6459994 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -21,7 +21,7 @@ update_head_ok=
exec=
upload_pack=
keep=
-depth=
+depth=0
while case "$#" in 0) break ;; esac
do
case "$1" in
@@ -304,7 +304,7 @@ fetch_main () {
# There are transports that can fetch only one head at a time...
case "$remote" in
http://* | https://* | ftp://*)
- test -n "$depth" && die "shallow clone with http not supported"
+ [ x"$depth" != x0 ] && die "shallow clone with http not supported"
proto=`expr "$remote" : '\([^:]*\):'`
if [ -n "$GIT_SSL_NO_VERIFY" ]; then
curl_extra_args="-k"
@@ -325,7 +325,7 @@ fetch_main () {
print "$u";
' "$head")
head=$(curl -nsfL $curl_extra_args $noepsv_opt "$remote/$remote_name_quoted")
- depth=$( expr \( $depth + 1 \) )
+ # depth=$( expr \( $depth + 1 \) )
done
expr "z$head" : "z$_x40\$" >/dev/null ||
die "Failed to fetch $remote_name from $remote"
@@ -333,7 +333,7 @@ fetch_main () {
git-http-fetch -v -a "$head" "$remote/" || exit
;;
rsync://*)
- test -n "$depth" && die "shallow clone with rsync not supported"
+ [ x"$depth" != x0 ] && die "shallow clone with http not supported"
TMP_HEAD="$GIT_DIR/TMP_HEAD"
rsync -L -q "$remote/$remote_name" "$TMP_HEAD" || exit 1
head=$(git-rev-parse --verify TMP_HEAD)
^ permalink raw reply related
* Re: [PATCH] git-svn: fix dcommit losing changes when out-of-date from svn
From: Steven Grimm @ 2006-11-09 22:37 UTC (permalink / raw)
To: Eric Wong; +Cc: Junio C Hamano, git
In-Reply-To: <20061109204759.GA8560@localdomain>
Eric Wong wrote:
> The commit runs as a transaction on the server-side, where all the real
> locking occurs. SVN supports user-side locking (svn lock), but it is
> only advisory and can be taken/unlocked by other users
> (svn lock/unlock --force).
>
Great, that sounds convincing to me. Thanks for such a quick turnaround
on this fix!
-Steve
^ permalink raw reply
* Re: [PATCH] git-svn: fix dcommit losing changes when out-of-date from svn
From: Eric Wong @ 2006-11-09 20:47 UTC (permalink / raw)
To: Steven Grimm; +Cc: Junio C Hamano, git
In-Reply-To: <455381C7.8080207@midwinter.com>
Steven Grimm <koreth@midwinter.com> wrote:
> Junio C Hamano wrote:
> >Steven, I do not interact with real svn repository myself so I
> >can only judge from the test in this patch and Steven's test
> >case, so it would be more assuring for me if you can confirm it
> >fixes the issue for you.
> >
>
> It seems to; I can't make the problem happen any more. I am slightly
> concerned -- but I don't know libsvn well enough to say for sure -- that
> this doesn't actually *eliminate* the problem, but rather tightens the
> window of opportunity down to some very small amount of time. Which is
> certainly an improvement, of course!
>
> Maybe only Eric can answer this, but from a cursory inspection, it
> doesn't look like it actually locks the modified files before generating
> the patch to apply. Is there still a possibility of losing a change that
> hits the svn repository in the middle of git-svn dcommit running? Or
> does locking happen implicitly somewhere I'm not seeing? (Again, I
> haven't combed the code deeply, so it's entirely possible I've missed
> something.)
The commit runs as a transaction on the server-side, where all the real
locking occurs. SVN supports user-side locking (svn lock), but it is
only advisory and can be taken/unlocked by other users
(svn lock/unlock --force).
When SVN::Git::Editor is instantiated in commit_diff() (line 853), the
'r' parameter passed to it is the revision we'll generate our diffs
against. Before, we were generating diffs against the latest revision.
We generate diffs against 'r' in SVN::Git::Editor::M() (line 3339) and
SVN::Git::Editor::chg_file (line 3383) passing the $fbat baton object
(which represents the file at revision 'r') around.
--
^ permalink raw reply
* Re: [PATCH] git-svn: fix dcommit losing changes when out-of-date from svn
From: Steven Grimm @ 2006-11-09 19:30 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Eric Wong, git
In-Reply-To: <7vfyctkki5.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> Steven, I do not interact with real svn repository myself so I
> can only judge from the test in this patch and Steven's test
> case, so it would be more assuring for me if you can confirm it
> fixes the issue for you.
>
It seems to; I can't make the problem happen any more. I am slightly
concerned -- but I don't know libsvn well enough to say for sure -- that
this doesn't actually *eliminate* the problem, but rather tightens the
window of opportunity down to some very small amount of time. Which is
certainly an improvement, of course!
Maybe only Eric can answer this, but from a cursory inspection, it
doesn't look like it actually locks the modified files before generating
the patch to apply. Is there still a possibility of losing a change that
hits the svn repository in the middle of git-svn dcommit running? Or
does locking happen implicitly somewhere I'm not seeing? (Again, I
haven't combed the code deeply, so it's entirely possible I've missed
something.)
-Steve
^ permalink raw reply
* Re: [PATCH] git-svn: fix dcommit losing changes when out-of-date from svn
From: Eric Wong @ 2006-11-09 19:22 UTC (permalink / raw)
To: Seth Falcon; +Cc: git
In-Reply-To: <m2r6wcy0t0.fsf@ziti.local>
Seth Falcon <sethfalcon@gmail.com> wrote:
> Junio C Hamano <junkio@cox.net> writes:
> > Eric Wong <normalperson@yhbt.net> writes:
> >
> >> There was a bug in dcommit (and commit-diff) which caused deltas
> >> to be generated against the latest version of the changed file
> >> in a repository, and not the revision we are diffing (the tree)
> >> against locally.
> >>
> >> This bug can cause recent changes to the svn repository to be
> >> silently clobbered by git-svn if our repository is out-of-date.
>
> Eric, with this patch, is a dcommit operation as safe as a regular svn
> commit from an svn working copy? That is, the commit will abort if
> the svn repository has changes that your git-svn/git repo hasn't yet
> seen? I'm pretty sure the answer is yes, but I'd like to be sure :-)
Yes, this is as safe as a regular svn commit from a working copy.
Transactions will abort if there are conflicts in the files being
committed.
--
^ permalink raw reply
* [PATCH] gitweb: Add an option to href() to return full URL
From: Jakub Narebski @ 2006-11-09 18:56 UTC (permalink / raw)
To: git
href() subroutine by default generates absolute URL (generated using
CGI::url(-absolute=>1), and saved in $my_uri) using $my_uri as base;
add an option to generate full URL using $my_url as base.
New feature usage: href(..., -full=>1)
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This is in preparation for git_rss cleanup (to use href), and further
per-branch (per-head) RSS feeds.
gitweb/gitweb.perl | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 8313517..f3fe4bf 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -459,7 +459,8 @@ exit;
sub href(%) {
my %params = @_;
- my $href = $my_uri;
+ # default is to use -absolute url() i.e. $my_uri
+ my $href = $params{-full} ? $my_url : $my_uri;
# XXX: Warning: If you touch this, check the search form for updating,
# too.
--
1.4.3.4
^ permalink raw reply related
* Re: [PATCH] git-svn: fix dcommit losing changes when out-of-date from svn
From: Seth Falcon @ 2006-11-09 17:42 UTC (permalink / raw)
To: git
In-Reply-To: <7vfyctkki5.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
> Eric Wong <normalperson@yhbt.net> writes:
>
>> There was a bug in dcommit (and commit-diff) which caused deltas
>> to be generated against the latest version of the changed file
>> in a repository, and not the revision we are diffing (the tree)
>> against locally.
>>
>> This bug can cause recent changes to the svn repository to be
>> silently clobbered by git-svn if our repository is out-of-date.
Eric, with this patch, is a dcommit operation as safe as a regular svn
commit from an svn working copy? That is, the commit will abort if
the svn repository has changes that your git-svn/git repo hasn't yet
seen? I'm pretty sure the answer is yes, but I'd like to be sure :-)
> Steven, I do not interact with real svn repository myself so I
> can only judge from the test in this patch and Steven's test
> case, so it would be more assuring for me if you can confirm it
> fixes the issue for you.
I'm not Steven, but I was reproducing the bug and with Eric's patch, I
get a nice error/abort when I try to dcommit when the svn repos has
relevant changes that I have not fetched yet.
Best,
^ 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