* [PATCH] format-patch: autonumber by default
From: Giuseppe Bilotta @ 2008-10-02 13:47 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski, Johannes Schindelin, Shawn O. Pearce,
Giuseppe Bilotta
In-Reply-To: <alpine.DEB.1.00.0810021541470.22125@pacific.mpi-cbg.de.mpi-cbg.de>
format-patch is most commoly used for multiple patches at once when
sending a patchset, in which case we want to number the patches; on the
other hand, single-patches are not usually expected to be numbered.
The typical behavior expected by format-patch is therefore the one
obtained by enabling autonumber, which should therefore be the default.
Users that want to disable numbering for a particular patchset can do so
with the existing -N command-line switch. For users that want to change
the default behavior we provide a 'noauto' option for the
format.numbering config key.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
---
builtin-log.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/builtin-log.c b/builtin-log.c
index fc5e4da..5187dc2 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -426,7 +426,7 @@ static int istitlechar(char c)
static const char *fmt_patch_suffix = ".patch";
static int numbered = 0;
-static int auto_number = 0;
+static int auto_number = 1;
static char **extra_hdr;
static int extra_hdr_nr;
@@ -484,6 +484,10 @@ static int git_format_config(const char *var, const char *value, void *cb)
auto_number = 1;
return 0;
}
+ if (value && !strcasecmp(value, "noauto")) {
+ auto_number = 0;
+ return 0;
+ }
numbered = git_config_bool(var, value);
return 0;
}
--
1.5.6.5
^ permalink raw reply related
* update-index --unresolve
From: SZEDER Gábor @ 2008-10-02 13:52 UTC (permalink / raw)
To: git
Dear All,
the documentation says following:
--unresolve::
Restores the 'unmerged' or 'needs updating' state of a
file during a merge if it was cleared by accident.
How could I clear those states by accident (or intentionally)?
Thanks,
Gábor
^ permalink raw reply
* Re: [PATCH] format-patch: autonumber by default
From: Johannes Sixt @ 2008-10-02 13:54 UTC (permalink / raw)
To: Giuseppe Bilotta; +Cc: Johannes Schindelin, git, Shawn O. Pearce
In-Reply-To: <cb7bb73a0810020610q657dec7clf85b4ef3575b751f@mail.gmail.com>
Giuseppe Bilotta schrieb:
> Now, about the reason for this patch: I would say that the most common
> use-case of format-patch being used to prepare multiple patches is
> when one plans on sending a patchset. When format.numbering is set to
> auto, single-patches will still be extracted without numbers, but
> patchset will be properly numbered.
>
> Of course, there may be cases where one doesn't want numbering (for
> which there is the -N flag already), and of course we want to give the
> user the choice to disable autonumbering at the config level, for
> which there is the new noauto option for format.numbering.
I recall that this has been discussed (months or years ago), but I don't
recall whether there was a conclusion or whether the change was dismissed.
Did you research the ML archives?
-- Hannes
^ permalink raw reply
* Re: update-index --unresolve
From: Jakub Narebski @ 2008-10-02 13:58 UTC (permalink / raw)
To: SZEDER Gábor; +Cc: git
In-Reply-To: <20081002135224.GC6839@neumann>
SZEDER Gábor <szeder@ira.uka.de> writes:
> Dear All,
>
> the documentation says following:
>
> --unresolve::
> Restores the 'unmerged' or 'needs updating' state of a
> file during a merge if it was cleared by accident.
>
> How could I clear those states by accident (or intentionally)?
"git add <file>", or "git update-index <file>", or error in handling
merge tool via git-mergetool.
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply
* Re: How to remove a commit object?
From: Michael J Gruber @ 2008-10-02 14:00 UTC (permalink / raw)
To: Klas Lindberg; +Cc: Steven Grimm, Git Users List
In-Reply-To: <33f4f4d70810020636g77f4180cm7aa6b7de07ae5beb@mail.gmail.com>
Klas Lindberg venit, vidit, dixit 02.10.2008 15:36:
> This doesn't seem to work for me. I will soon be in a situation where
> I need to selectively delete commits in such a way that they become
> completely irrecoverable. I.e. it is not enough to revert a commit.
> The *original* commit must be removed. And of course, the repo history
> is too complex to allow for rebasing followed by garbage collection or
> something like that.
>
> The reason is that we consider opening a repository to external
> participants, but some commits contain stuff that we'd really rather
> not show to anyone else. Making the repository public without loosing
> history would then force us to either
>
> 1. Recreate every commit in a new repo, sans the offending commits.
> Seems like hard work.
> 2. ?
>
> Would it be feasible to write a tool that can selectively replace a
> specific commit in the commit DAG, or would that automatically
> invalidate every SHA key for every commit that follows the replaced
> original?
Yes, on the or part: If you change a commit then all commits "after"
that one (in terms of DAG connectedness) will need to be changed: each
contains a "backpointer" (to the parent commit(s)) which is changed.
I'm a bit confused: You rule out rebasing but don't mind recreating a
new repo. So repo size is not a problem, is it?
Michael
^ permalink raw reply
* Re: Git commit hash clash prevention
From: Jakub Narebski @ 2008-10-02 14:00 UTC (permalink / raw)
To: martin f krafft; +Cc: git discussion list
In-Reply-To: <20081002085358.GA5342@lapse.rw.madduck.net>
martin f krafft <madduck@madduck.net> writes:
> the other day during a workshop on Git, one of the attendants asked
> about the scenario when two developers, Jane and David, both working
> on the same project, both create a commit and the two just so happen
> to have the same SHA-1. I realise that the likelihood of this
> happening is about as high as the chance of <insert witty joke
> here>, but it *is* possible, isn't it? Even though this is thus
> somewhat academic, I am still very curious about it.
>
> What happens when David now pulls from Jane? How does Git deal with
> this?
Cannot happen in practice.
But just in case git trusts object it already has in repository over
object which just got fetched (or pushed).
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply
* Files with colons under Cygwin
From: Giovanni Funchal @ 2008-10-02 14:02 UTC (permalink / raw)
To: git
Hello,
Cygwin does not allow files with colons, I think this is Windows stuff
one just can't avoid. If you have files with colons in a git
repository and try pulling them on cygwin, the file is empty, its name
is truncated and the status is wrong.
linux $ date > a:b
linux $ git init
linux $ git add a:b
linux $ git commit -m test
linux $ git push
cygwin $ git pull
cygwin $ ls
-rw-r--r-- 1 funchal funchal 0 Oct 2 15:15 a
cygwin $ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# a
nothing added to commit but untracked files present (use "git add" to track)
Any ideas on what should be done? (for instance, warn when pulling
this kind of files on Cygwin)
Has anyone noticed this before?
Regards,
-- Giovanni
^ permalink raw reply
* Re: How to remove a commit object?
From: Jakub Narebski @ 2008-10-02 14:02 UTC (permalink / raw)
To: Klas Lindberg; +Cc: Michael J Gruber, Steven Grimm, Git Users List
In-Reply-To: <33f4f4d70810020636g77f4180cm7aa6b7de07ae5beb@mail.gmail.com>
"Klas Lindberg" <klas.lindberg@gmail.com> writes:
> This doesn't seem to work for me. I will soon be in a situation where
> I need to selectively delete commits in such a way that they become
> completely irrecoverable. I.e. it is not enough to revert a commit.
> The *original* commit must be removed. And of course, the repo history
> is too complex to allow for rebasing followed by garbage collection or
> something like that.
[...]
> Would it be feasible to write a tool that can selectively replace a
> specific commit in the commit DAG, or would that automatically
> invalidate every SHA key for every commit that follows the replaced
> original?
It would invalidate SHA1 for every commit after first rewritten.
There are two tools which you can use to rewrite large parts of
history automatically: git-filter-branch, and git-fast-export +
git-fast-import.
HTH
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply
* Re: [PATCH] format-patch: autonumber by default
From: Jakub Narebski @ 2008-10-02 14:08 UTC (permalink / raw)
To: Giuseppe Bilotta; +Cc: git, Johannes Schindelin, Shawn O. Pearce
In-Reply-To: <1222955278-16908-1-git-send-email-giuseppe.bilotta@gmail.com>
Giuseppe Bilotta wrote:
> format-patch is most commoly used for multiple patches at once when
s/commoly/commonly/;
I'm not sure about 'most' there...
> sending a patchset, in which case we want to number the patches; on the
> other hand, single-patches are not usually expected to be numbered.
>
> The typical behavior expected by format-patch is therefore the one
> obtained by enabling autonumber, which should therefore be the default.
>
> Users that want to disable numbering for a particular patchset can do so
> with the existing -N command-line switch. For users that want to change
> the default behavior we provide a 'noauto' option for the
> format.numbering config key.
Nice. I like it.
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: [PATCH] format-patch: autonumber by default
From: Andreas Ericsson @ 2008-10-02 14:14 UTC (permalink / raw)
To: Jakub Narebski
Cc: Giuseppe Bilotta, git, Johannes Schindelin, Shawn O. Pearce
In-Reply-To: <200810021608.54287.jnareb@gmail.com>
Jakub Narebski wrote:
> Giuseppe Bilotta wrote:
>> format-patch is most commoly used for multiple patches at once when
>
> s/commoly/commonly/;
>
> I'm not sure about 'most' there...
In that case, just make it "often" and cut "most commoly" (sic) out.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
^ permalink raw reply
* Re: update-index --unresolve
From: SZEDER Gábor @ 2008-10-02 14:18 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <m3tzbvqesz.fsf@localhost.localdomain>
Hi Jakub,
On Thu, Oct 02, 2008 at 06:58:41AM -0700, Jakub Narebski wrote:
> SZEDER Gábor <szeder@ira.uka.de> writes:
> > --unresolve::
> > Restores the 'unmerged' or 'needs updating' state of a
> > file during a merge if it was cleared by accident.
> >
> > How could I clear those states by accident (or intentionally)?
>
> "git add <file>", or "git update-index <file>", or error in handling
> merge tool via git-mergetool.
Thanks for your fast reply.
However:
# ... do a conflicting merge
(master|MERGING)$ echo 4 >one
(master|MERGING)$ git status
one: needs merge
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working
# directory)
#
# unmerged: one
#
no changes added to commit (use "git add" and/or "git commit -a")
(master|MERGING)$ git add one
(master|MERGING)$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: one
#
(master|MERGING)$ git update-index --unresolve
(master|MERGING)$ echo $?
0
(master|MERGING)$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: one
#
So, as you can see, after 'add ; update-index --unresolve' the file is
not marked as unmerged, but it's still ready to be committed.
Is something wrong going on here, or it is indeed the intended
behaviour and I misunderstood this functionality?
Thanks,
Gábor
^ permalink raw reply
* Re: [PATCH] gitweb: remove PATH_INFO from $my_url and $my_uri
From: Petr Baudis @ 2008-10-02 14:22 UTC (permalink / raw)
To: Giuseppe Bilotta; +Cc: git, Jakub Narebski, Junio C Hamano, Shawn O. Pearce
In-Reply-To: <1222693662-27426-1-git-send-email-giuseppe.bilotta@gmail.com>
On Mon, Sep 29, 2008 at 03:07:42PM +0200, Giuseppe Bilotta wrote:
> This patch fixes PATH_INFO handling by removing the relevant part from
> $my_url and $my_uri, thus making it unnecessary to specify them by hand
> in the gitweb configuration.
>
> Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
^ permalink raw reply
* [PATCH] gitweb: Identify all summary metadata table rows
From: Petr Baudis @ 2008-10-02 14:25 UTC (permalink / raw)
To: git, git; +Cc: Petr Baudis
In the metadata table of the summary page, all rows have their
id (or class in case of URL) set now. This for example lets sites
easily disable fields they do not want to show in their custom
stylesheet (e.g. they are overly technical or irrelevant for the site).
Many of my other patches depend on this, so I would appreciate to hear
as soon as possible if someone has an issue with this patch.
Signed-off-by: Petr Baudis <petr.baudis@novartis.com>
---
gitweb/gitweb.perl | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index da474d0..bd8124a 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4070,10 +4070,10 @@ sub git_summary {
print "<div class=\"title\"> </div>\n";
print "<table class=\"projects_list\">\n" .
- "<tr><td>description</td><td>" . esc_html($descr) . "</td></tr>\n" .
- "<tr><td>owner</td><td>" . esc_html($owner) . "</td></tr>\n";
+ "<tr id=\"metadata_desc\"><td>description</td><td>" . esc_html($descr) . "</td></tr>\n" .
+ "<tr id=\"metadata_owner\"><td>owner</td><td>" . esc_html($owner) . "</td></tr>\n";
if (defined $cd{'rfc2822'}) {
- print "<tr><td>last change</td><td>$cd{'rfc2822'}</td></tr>\n";
+ print "<tr id=\"metadata_lchange\"><td>last change</td><td>$cd{'rfc2822'}</td></tr>\n";
}
# use per project git URL list in $projectroot/$project/cloneurl
@@ -4083,7 +4083,7 @@ sub git_summary {
@url_list = map { "$_/$project" } @git_base_url_list unless @url_list;
foreach my $git_url (@url_list) {
next unless $git_url;
- print "<tr><td>$url_tag</td><td>$git_url</td></tr>\n";
+ print "<tr class=\"metadata_url\"><td>$url_tag</td><td>$git_url</td></tr>\n";
$url_tag = "";
}
print "</table>\n";
--
tg: (c427559..) t/summary/css-metadata (depends on: vanilla/master)
^ permalink raw reply related
* Re: update-index --unresolve
From: SZEDER Gábor @ 2008-10-02 14:25 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <20081002141853.GD6839@neumann>
On Thu, Oct 02, 2008 at 04:18:53PM +0200, SZEDER Gábor wrote:
> > > How could I clear those states by accident (or intentionally)?
> >
> > "git add <file>", or "git update-index <file>", or error in handling
> > merge tool via git-mergetool.
> Thanks for your fast reply.
>
> However:
>
> # ... do a conflicting merge
> (master|MERGING)$ echo 4 >one
> (master|MERGING)$ git status
> one: needs merge
> # On branch master
> # Changed but not updated:
> # (use "git add <file>..." to update what will be committed)
> # (use "git checkout -- <file>..." to discard changes in working
> # directory)
> #
> # unmerged: one
> #
> no changes added to commit (use "git add" and/or "git commit -a")
> (master|MERGING)$ git add one
> (master|MERGING)$ git status
> # On branch master
> # Changes to be committed:
> # (use "git reset HEAD <file>..." to unstage)
> #
> # modified: one
> #
> (master|MERGING)$ git update-index --unresolve
Ah, that should be 'git update-index --unresolve one', and
everything works as expected.
Sorry,
Gábor
^ permalink raw reply
* Re: How to remove a commit object?
From: Klas Lindberg @ 2008-10-02 14:26 UTC (permalink / raw)
To: Jakub Narebski; +Cc: Michael J Gruber, Steven Grimm, Git Users List
In-Reply-To: <m3ljx7qemk.fsf@localhost.localdomain>
Repo size is a problem too, actually.
A solution to both problems seemed to be to use git-filter-branch to
create a new repo by filtering out all the unwanted files. The
astonishing result was that, for the subdirectory I tried it on, 90%
or so of the commits on that subdirectory just disappeared. It didn't
look right at all. Although I can't say for sure exactly what I did
with filter-branch, I would appreciate some guidance for using it. It
basically seemed to do exactly what I wanted (recreate the repo, minus
some explicit stuff, with history intact otherwise), except the result
looked crazy.
/Klas
On Thu, Oct 2, 2008 at 4:02 PM, Jakub Narebski <jnareb@gmail.com> wrote:
> "Klas Lindberg" <klas.lindberg@gmail.com> writes:
>
>> This doesn't seem to work for me. I will soon be in a situation where
>> I need to selectively delete commits in such a way that they become
>> completely irrecoverable. I.e. it is not enough to revert a commit.
>> The *original* commit must be removed. And of course, the repo history
>> is too complex to allow for rebasing followed by garbage collection or
>> something like that.
> [...]
>
>> Would it be feasible to write a tool that can selectively replace a
>> specific commit in the commit DAG, or would that automatically
>> invalidate every SHA key for every commit that follows the replaced
>> original?
>
> It would invalidate SHA1 for every commit after first rewritten.
> There are two tools which you can use to rewrite large parts of
> history automatically: git-filter-branch, and git-fast-export +
> git-fast-import.
>
> HTH
> --
> Jakub Narebski
> Poland
> ShadeHawk on #git
>
^ permalink raw reply
* Re: corrupted repository?
From: Shawn O. Pearce @ 2008-10-02 14:29 UTC (permalink / raw)
To: Francois Pepin; +Cc: git
In-Reply-To: <48E3EBC2.7090107@cs.mcgill.ca>
Francois Pepin <fpepin@cs.mcgill.ca> wrote:
> Everything seems to be working properly there (git fsck --full returns
> normally with no output), but I cannot clone or pull from my other
> machines:
...
> [francois@Iduna ~]$ git clone localhost:git git2
> Initialized empty Git repository in /Users/francois/git2/.git/
> remote: fatal: exec pack-objects failed.
Your git-upload-pack cannot find git-pack-objects. It sounds like
Git was incorrectly installed on your system.
which git-upload-pack ?
which git ?
are they in the same directory?
did you possibly move git after installing it?
git --exec-path?
does that exist?
does it have git-pack-objects inside it?
> I am running git 1.6.0.2 on the mac, and have only recently updated it
> so that might have a role to play.
I think it is the upgrade. It sounds like its not installed correcly
because the helpers in libexec/git-core cannot be found.
--
Shawn.
^ permalink raw reply
* Re: How to remove a commit object?
From: Michael J Gruber @ 2008-10-02 14:30 UTC (permalink / raw)
To: Klas Lindberg; +Cc: Jakub Narebski, Steven Grimm, Git Users List
In-Reply-To: <33f4f4d70810020726g71c6f39eq16585269fb268322@mail.gmail.com>
Klas Lindberg venit, vidit, dixit 02.10.2008 16:26:
> Repo size is a problem too, actually.
>
> A solution to both problems seemed to be to use git-filter-branch to
> create a new repo by filtering out all the unwanted files. The
> astonishing result was that, for the subdirectory I tried it on, 90%
> or so of the commits on that subdirectory just disappeared. It didn't
> look right at all. Although I can't say for sure exactly what I did
> with filter-branch, I would appreciate some guidance for using it. It
I don't know about others, but I would appreciate more info:
Do you want to remove commits (as stated earlier) or files (as stated here)?
What are the boundary conditions? Rewriting history seems to be OK now.
> basically seemed to do exactly what I wanted (recreate the repo, minus
> some explicit stuff, with history intact otherwise), except the result
> looked crazy.
That may be due to the filter-branch incarnation, i.e. which refs did
you rewrite (--all or HEAD)?
Michael
^ permalink raw reply
* [PATCH] gitweb: Add support for extending the action bar with custom links
From: Petr Baudis @ 2008-10-02 14:36 UTC (permalink / raw)
To: git, git
This makes it possible to easily extend gitweb with custom functionality,
e.g. git-browser or web-based repository administration system like
the repo.or.cz/Girocco duct tape.
Signed-off-by: Petr Baudis <pasky@suse.cz>
---
gitweb/gitweb.perl | 35 ++++++++++++++++++++++++++++++++++-
1 files changed, 34 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index da474d0..9fbc9f8 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -275,6 +275,26 @@ our %feature = (
'forks' => {
'override' => 0,
'default' => [0]},
+
+ # Insert custom links to the action bar of all project pages.
+ # This enables you mainly to link to third-party scripts integrating
+ # into gitweb; e.g. git-browser for graphical history representation
+ # or custom web-based repository administration interface.
+
+ # The 'default' value consists of a list of triplets in the form
+ # (label, link, position) where position is the label after which
+ # to inster the link and link is a format string where %n expands
+ # to the project name, %f to the project path within the filesystem,
+ # %h to the current hash (h gitweb parameter) and %b to the current
+ # hash base (hb gitweb parameter).
+
+ # To enable system wide have in $GITWEB_CONFIG e.g.
+ # $feature{'actions'}{'default'} = [('graphiclog',
+ # '/git-browser/by-commit.html?r=%n', 'summary')];
+ # Project specific override is not supported.
+ 'actions' => {
+ 'override' => 0,
+ 'default' => []},
);
sub gitweb_check_feature {
@@ -2757,13 +2777,26 @@ sub git_print_page_nav {
}
}
}
+
$arg{'tree'}{'hash'} = $treehead if defined $treehead;
$arg{'tree'}{'hash_base'} = $treebase if defined $treebase;
+ my @actions = gitweb_check_feature('actions');
+ while (@actions) {
+ my ($label, $link, $pos) = (shift(@actions), shift(@actions), shift(@actions));
+ @navs = map { $_ eq $pos ? ($_, $label) : $_ } @navs;
+ # munch munch
+ $link =~ s#%n#$project#g;
+ $link =~ s#%f#$git_dir#g;
+ $treehead ? $link =~ s#%h#$treehead#g : $link =~ s#%h##g;
+ $treebase ? $link =~ s#%b#$treebase#g : $link =~ s#%b##g;
+ $arg{$label}{'_href'} = $link;
+ }
+
print "<div class=\"page_nav\">\n" .
(join " | ",
map { $_ eq $current ?
- $_ : $cgi->a({-href => href(%{$arg{$_}})}, "$_")
+ $_ : $cgi->a({-href => ($arg{$_}{_href} ? $arg{$_}{_href} : href(%{$arg{$_}}))}, "$_")
} @navs);
print "<br/>\n$extra<br/>\n" .
"</div>\n";
--
tg: (c427559..) t/extra-actions/extra-actions (depends on: vanilla/master)
^ permalink raw reply related
* Re: git svn bug?
From: Björn Steinbrink @ 2008-10-02 14:49 UTC (permalink / raw)
To: Ark Xu; +Cc: git
In-Reply-To: <36C9BCCC-875A-4C65-98E2-0AD486FF8F61@gmail.com>
On 2008.10.02 16:50:45 +0800, Ark Xu wrote:
> Hi guys,
>
> I like git very much so I also use git svn for subversion repo.
>
> Now I got a tough problem which stopping me for any svn related
> operations. There is a file log4j.xml that is somehow strange because
> when I fetch it, i got the following message:
>
> tms-service/src/test/resources/log4j.xml has mode 120000 but is not a
> link at /opt/local/bin/git-svn line 3230.
> M tms-service/src/test/resources/log4j.xml
>
> And then, all the operation will lead to :
> Checksum mismatch: branches/5.3/tms-service/src/test/resources/log4j.xml
> 51031cbb0e1a2e878e4a3836cf0baa9b80a037a5
> expected: fab6daef9fc355b9342e26047f5d0141
> got: 0e7e9081d608c80d2de0340ba5cd1600
>
> Could anybody help?
Which git version? And is your /tmp large enough to store that file?
Björn
^ permalink raw reply
* Re: Help with a tcl/tk gui thing..
From: Linus Torvalds @ 2008-10-02 14:49 UTC (permalink / raw)
To: Mikael Magnusson; +Cc: Git Mailing List
In-Reply-To: <237967ef0810012218i28d41573s6bb7866e0be485f2@mail.gmail.com>
On Thu, 2 Oct 2008, Mikael Magnusson wrote:
>
> Heh, sorry, I'm an idiot. I forgot to put '#!/usr/bin/python' on the first
> line. I was running 'python tracker-ui.py' then did chmod +x just before
> committing :). So the cross is coming from running 'import time'.
Ahh. It did _something_, so I assumed it was working, just not well. Being
confused about the language would do it ;)
I fixed it up and merged it as an alternate UI. It doesn't react well to a
tracker file that has just been initialized with the timeout (but without
any of the extra information that gets filled out once you actually start
getting tracked), but it's certainly prettier than my original one.
Thanks,
Linus
^ permalink raw reply
* [PATCH (BUGFIX)] gitweb: Fix two 'uninitialized value' varnings in git_tree()
From: Jakub Narebski @ 2008-10-02 14:50 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski
If we did try to access nonexistent directory or file, which means
that git_get_hash_by_path() returns `undef`, uninitialized $hash
variable was passed to 'open' call. Now we fail early with "404 Not
Found - No such tree" error. (If we try to access something which
does not resolve to tree-ish, for example a file / 'blob' object, the
error will be caught later, as "404 Not Found - Reading tree failed"
error).
If we tried to use 'tree' action without $file_name ('f' parameter)
set, which means either tree given by hash or a top tree (and we
currently cannot distinguish between those two cases), we cannot print
path breadcrumbs with git_print_page_path(). Fix this by moving call
to git_print_page_path() inside conditional.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Those two errors were discovered when creating new basic test for
path_info (following).
I was also thinking about alternate solution of using instead
"$hash_base:$file_name" for $hash, but it caused some errors I didn't
feel like debugging. Current diff is also smaller than mentioned
solution.
BTW. should we use "No such tree" or "No such directory".
gitweb/gitweb.perl | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 18e70a3..bb20ed7 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4445,6 +4445,7 @@ sub git_tree {
$hash = $hash_base;
}
}
+ die_error(404, "No such tree") unless defined($hash);
$/ = "\0";
open my $fd, "-|", git_cmd(), "ls-tree", '-z', $hash
or die_error(500, "Open git-ls-tree failed");
@@ -4485,8 +4486,8 @@ sub git_tree {
if ($basedir ne '' && substr($basedir, -1) ne '/') {
$basedir .= '/';
}
+ git_print_page_path($file_name, 'tree', $hash_base);
}
- git_print_page_path($file_name, 'tree', $hash_base);
print "<div class=\"page_body\">\n";
print "<table class=\"tree\">\n";
my $alternate = 1;
^ permalink raw reply related
* [PATCH] gitweb: Add path_info tests to t/t9500-gitweb-standalone-no-errors.sh
From: Jakub Narebski @ 2008-10-02 14:52 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski
Note that those tests only that there are no errors nor warnings
from Perl; they do not check for example if gitweb doesn't use
ARRAY(0x8e3cc20) instead of correct value in links, etc.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This is the test thans to which I have dicovered errors in git_tree()
fixed in previous email. Nevertheless those two patches are unrelated,
so they are not numbered.
Those tests check _current_ situation, without $action, not
$hash_parent parameters possible in path_info.
t/t9500-gitweb-standalone-no-errors.sh | 49 ++++++++++++++++++++++++++++++++
1 files changed, 49 insertions(+), 0 deletions(-)
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index 07117a8..64c4cce 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -503,6 +503,55 @@ test_expect_success \
test_debug 'cat gitweb.log'
# ----------------------------------------------------------------------
+# path_info links
+test_expect_success \
+ 'path_info: project' \
+ 'gitweb_run "" "/.git"'
+test_debug 'cat gitweb.log'
+
+test_expect_success \
+ 'path_info: project/branch' \
+ 'gitweb_run "" "/.git/b"'
+test_debug 'cat gitweb.log'
+
+test_expect_success \
+ 'path_info: project/branch:file' \
+ 'gitweb_run "" "/.git/master:file"'
+test_debug 'cat gitweb.log'
+
+test_expect_success \
+ 'path_info: project/branch:dir/' \
+ 'gitweb_run "" "/.git/master:foo/"'
+test_debug 'cat gitweb.log'
+
+test_expect_success \
+ 'path_info: project/branch:file (non-existent)' \
+ 'gitweb_run "" "/.git/master:non-existent"'
+test_debug 'cat gitweb.log'
+
+test_expect_success \
+ 'path_info: project/branch:dir/ (non-existent)' \
+ 'gitweb_run "" "/.git/master:non-existent/"'
+test_debug 'cat gitweb.log'
+
+
+test_expect_success \
+ 'path_info: project/branch:/file' \
+ 'gitweb_run "" "/.git/master:/file"'
+test_debug 'cat gitweb.log'
+
+test_expect_success \
+ 'path_info: project/:/file (implicit HEAD)' \
+ 'gitweb_run "" "/.git/:/file"'
+test_debug 'cat gitweb.log'
+
+test_expect_success \
+ 'path_info: project/:/ (implicit HEAD, top tree)' \
+ 'gitweb_run "" "/.git/:/"'
+test_debug 'cat gitweb.log'
+
+
+# ----------------------------------------------------------------------
# feed generation
test_expect_success \
^ permalink raw reply related
* Re: How to remove a commit object?
From: Klas Lindberg @ 2008-10-02 14:52 UTC (permalink / raw)
To: Michael J Gruber; +Cc: Jakub Narebski, Steven Grimm, Git Users List
In-Reply-To: <48E4DB21.7020304@drmicha.warpmail.net>
What I really want is to remove files, but when filter-branch didn't
seem to do what I wanted, I turned to the idea of rewriting single
commits to not include the files in question.
This is what I tried with filter-branch: gitk --all shows about 170
commits on directory D in the repo. Of these, maybe 10 don't lead to
HEAD, but dangle off the main track. As a test, I decided to let
filter-branch create a new repo that only contained the contents of
subdirectory B. So I ran
git-filter-branch --subdirectory-filter B -- --all
and now the resulting repo has just 14 commits. This is clearly not
what I wanted because a lot of the original history for subdirectory B
is just missing.
Actually, in this particular case I get the exact same result with
git-filter-branch --subdirectory-filter B HEAD
BR / Klas
On Thu, Oct 2, 2008 at 4:30 PM, Michael J Gruber
<git@drmicha.warpmail.net> wrote:
> Klas Lindberg venit, vidit, dixit 02.10.2008 16:26:
>> Repo size is a problem too, actually.
>>
>> A solution to both problems seemed to be to use git-filter-branch to
>> create a new repo by filtering out all the unwanted files. The
>> astonishing result was that, for the subdirectory I tried it on, 90%
>> or so of the commits on that subdirectory just disappeared. It didn't
>> look right at all. Although I can't say for sure exactly what I did
>> with filter-branch, I would appreciate some guidance for using it. It
>
> I don't know about others, but I would appreciate more info:
> Do you want to remove commits (as stated earlier) or files (as stated here)?
> What are the boundary conditions? Rewriting history seems to be OK now.
>
>> basically seemed to do exactly what I wanted (recreate the repo, minus
>> some explicit stuff, with history intact otherwise), except the result
>> looked crazy.
>
> That may be due to the filter-branch incarnation, i.e. which refs did
> you rewrite (--all or HEAD)?
>
> Michael
>
^ permalink raw reply
* Re: git svn bug?
From: Deskin Miller @ 2008-10-02 14:59 UTC (permalink / raw)
To: Björn Steinbrink; +Cc: Ark Xu, git
In-Reply-To: <20081002144916.GA3644@atjola.homenet>
On Thu, Oct 2, 2008 at 10:49 AM, Björn Steinbrink <B.Steinbrink@gmx.de> wrote:
> On 2008.10.02 16:50:45 +0800, Ark Xu wrote:
>> Now I got a tough problem which stopping me for any svn related
>> operations. There is a file log4j.xml that is somehow strange because
>> when I fetch it, i got the following message:
>>
>> tms-service/src/test/resources/log4j.xml has mode 120000 but is not a
>> link at /opt/local/bin/git-svn line 3230.
>> M tms-service/src/test/resources/log4j.xml
>>
>> And then, all the operation will lead to :
>> Checksum mismatch: branches/5.3/tms-service/src/test/resources/log4j.xml
>> 51031cbb0e1a2e878e4a3836cf0baa9b80a037a5
>> expected: fab6daef9fc355b9342e26047f5d0141
>> got: 0e7e9081d608c80d2de0340ba5cd1600
>
> Which git version? And is your /tmp large enough to store that file?
I've had issues similar to this when I did Ctrl+C during git svn
fetch. Prior to the issue you've pointed out popping up, though, I
could compare the repo against another git svn fetch which was not
interrupted, and the commits would diverge at some point. When I
looked into the commit which diverged, the commit object was present
in my interrupted repo, but the diff was empty, while it was non-empty
in the other repo.
It seems there's an issue with git svn fetch atomically fetching and
updating its refs. I've not had time to investigate further, but I
certainly want to.
In the meantime, I worked around it on initial fetch from a big svn
repository by using git svn fetch -r1:n , and increasing n in
increments, so it could run to completion without me interrupting it.
This was seen using git 1.5.4.3 from Ubuntu.
Deskin Miller
^ permalink raw reply
* Re: Help with a tcl/tk gui thing..
From: Mikael Magnusson @ 2008-10-02 15:01 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Git Mailing List
In-Reply-To: <alpine.LFD.2.00.0810020746480.3341@nehalem.linux-foundation.org>
2008/10/2 Linus Torvalds <torvalds@linux-foundation.org>:
>
>
> On Thu, 2 Oct 2008, Mikael Magnusson wrote:
>>
>> Heh, sorry, I'm an idiot. I forgot to put '#!/usr/bin/python' on the first
>> line. I was running 'python tracker-ui.py' then did chmod +x just before
>> committing :). So the cross is coming from running 'import time'.
>
> Ahh. It did _something_, so I assumed it was working, just not well. Being
> confused about the language would do it ;)
>
> I fixed it up and merged it as an alternate UI. It doesn't react well to a
> tracker file that has just been initialized with the timeout (but without
> any of the extra information that gets filled out once you actually start
> getting tracked), but it's certainly prettier than my original one.
Ah, I didn't play around too much with the actual server part, but I guess
that would get sort of annoying, so I pushed a fix for that, and also it
now sets the window title right.
I should also note that I'm not exactly a python master, so if it looks ugly,
blame me, not python :).
--
Mikael Magnusson
^ 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