* Re: [PATCH 1/5] avoid parse_sha1_header() accessing memory out of bound
From: Shawn O. Pearce @ 2008-12-02 15:42 UTC (permalink / raw)
To: Liu Yubao; +Cc: Junio C Hamano, git list
In-Reply-To: <4934949B.70307@gmail.com>
Liu Yubao <yubao.liu@gmail.com> wrote:
> diff --git a/sha1_file.c b/sha1_file.c
> index 6c0e251..efe6967 100644
> --- a/sha1_file.c
> +++ b/sha1_file.c
> @@ -1254,10 +1255,10 @@ static int parse_sha1_header(const char *hdr, unsigned long *sizep)
> /*
> * The type can be at most ten bytes (including the
> * terminating '\0' that we add), and is followed by
> - * a space.
> + * a space, at least one byte for size, and a '\0'.
> */
> i = 0;
> - for (;;) {
> + while (hdr < hdr_end - 2) {
> char c = *hdr++;
> if (c == ' ')
> break;
> @@ -1265,6 +1266,8 @@ static int parse_sha1_header(const char *hdr, unsigned long *sizep)
> if (i >= sizeof(type))
> return -1;
That first hunk I am citing is unnecessary, because of the lines
right above. All of the callers of this function pass in a buffer
that is at least 32 bytes in size; this loop aborts if it does not
find a ' ' within the first 10 bytes of the buffer. We'll never
access memory outside of the buffer during this loop.
So IMHO your first three hunks here aren't necessary.
> @@ -1275,7 +1278,7 @@ static int parse_sha1_header(const char *hdr, unsigned long *sizep)
> if (size > 9)
> return -1;
> if (size) {
> - for (;;) {
> + while (hdr < hdr_end - 1) {
> unsigned long c = *hdr - '0';
> if (c > 9)
> break;
OK, there's no promise here that we don't roll off the buffer.
This can be fixed in the caller, ensuring we always have the '\0'
at some point in the initial header buffer we were asked to parse:
diff --git a/sha1_file.c b/sha1_file.c
index 6c0e251..26c6ffb 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1162,9 +1162,10 @@ static int unpack_sha1_header(z_stream *stream, unsigned char *map, unsigned lon
stream->next_in = map;
stream->avail_in = mapsize;
stream->next_out = buffer;
- stream->avail_out = bufsiz;
if (legacy_loose_object(map)) {
+ stream->avail_out = bufsiz - 1;
+ buffer[bufsiz - 1] = '\0';
inflateInit(stream);
return inflate(stream, 0);
}
@@ -1186,6 +1187,7 @@ static int unpack_sha1_header(z_stream *stream, unsigned char *map, unsigned lon
/* Set up the stream for the rest.. */
stream->next_in = map;
stream->avail_in = mapsize;
+ stream->avail_out = bufsiz;
inflateInit(stream);
/* And generate the fake traditional header */
--
Shawn.
^ permalink raw reply related
* Re: [StGit PATCH] Do not append a new line to the backwards compat files (bug #12656)
From: Karl Hasselström @ 2008-12-02 15:39 UTC (permalink / raw)
To: Catalin Marinas; +Cc: git
In-Reply-To: <20081202143839.24221.90893.stgit@localhost.localdomain>
On 2008-12-02 14:38:39 +0000, Catalin Marinas wrote:
> Since the multiline argument wasn't passed to the
> utils.write_string() function when writing the compatibility
> description file from the new infrastructure, any older command like
> push would have committed these new lines.
>
> Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
Acked-by: Karl Hasselström <kha@treskal.com>
Thanks.
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle
^ permalink raw reply
* Re: git-svn rebase "problems"
From: Michael J Gruber @ 2008-12-02 15:32 UTC (permalink / raw)
To: Joe Fiorini; +Cc: git
In-Reply-To: <73fd69b50812020656u3fd17015n267f694236982e5@mail.gmail.com>
Joe Fiorini venit, vidit, dixit 02.12.2008 15:56:
> Are there any other details I can provide to get an answer on this?
>
> Thanks!
> Joe
>
> On Sun, Nov 30, 2008 at 10:17 PM, Joe Fiorini <joe@faithfulgeek.org> wrote:
>> I'm having some problems with git svn rebase. I'm pretty sure this is
>> just the way git works, not a problem per se. But it's causing trouble
>> for me and my team.
>> My team is currently on Subversion. I'm trying to convince some people
>> that git is a good way to go.
>>
>> So I'm using git-svn. My team tends to commit to the svn server fairly
>> often. It has happened more than once that, because git svn rebase
>> applies each svn commit sequentially, some of the commits will
>> conflict with each other - whether or not I have ever touched the
git svn rebase fetches all svn commits and then rebases your current
branch onto FETCH_HEAD (the last svn commit). In doing so, it applies
the commits you have on your branch (since merge base) one by one.
What do you mean by "applies each svn commit sequentially"?
>> file. Obviously, this is a big problem because if I've never touched
>> the file, then I probably won't know exactly how to resolve the merge
>> (the merge markers haven't been solely reliable).
If you develop on a local branch and get conflicts with others' commits
someone has to resolve them, whether you use git or svn. But I'm
surprised there are conflicts in files you didn't touch. Can you share
more details on the files or the workflow/repo?
Michael
^ permalink raw reply
* Re: more merge strategies : feature request
From: Jeff King @ 2008-12-02 15:30 UTC (permalink / raw)
To: Caleb Cushing; +Cc: Andreas Ericsson, git
In-Reply-To: <81bfc67a0812020628l53c209a6yca5a619d211b6bfc@mail.gmail.com>
On Tue, Dec 02, 2008 at 09:28:41AM -0500, Caleb Cushing wrote:
> I'm afraid I don't fully understand your example
>
>
> lets say git merge foo bar
> foo bar
> 1 1
> 2 8
> 3 3
> 4 4
> 5 5
> 6
> 7
I notice that you don't have a "merge base" here, which is an important
part of determining conflicts. So if you are proposing to not look at
the history at all, and just show all differences, then that is
different from what I thought you meant.
> lines 6 and 7 are new in foo line 2 has a conflict because the other
> head has an 8, history wise because of an early merge the other
> direction and fix, there was the 8 in foo and it was changed to a 2,
> when I merge back it will overwrite the 8 with a 2. however I need
> the 8 to be the 8 and the 2 to be the 2. but I want the 6 and 7 in
> both.
>
> conflict would create a conflict
>
> such as
>
> foo
> 1
> <<<<<< bar
> 8
> ======
> 2
> >>>>>> foo
> 3
> 4
> 5
> 6
> 7
OK, so assume we throw away history and just look at the diff between
the two branches. How do we know that a conflict should be created for
the 2 vs 8, but not for the added "6 7" at the end? I think you have to
create a conflict marker for both and fix them up manually. Like:
1
<<<<<<< foo
2
=======
8
>>>>>>> bar
3
4
5
<<<<<<< foo
6
7
=======
>>>>>>> bar
The script below munges a diff into conflict markers (and created the
output you see above). Note that it is very hacky and not very tested.
And note that at this point this really has nothing to do with _git_
specifically, since we aren't even using history. This just generates
conflict markers from two files. There may be a more mature tool that
can accomplish the same thing (personally, I would use something like
xxdiff to do an interactive merge in your case).
You can try it with:
git config merge.conflict.driver 'perl /path/to/conflict.pl %A %B'
echo '* merge=conflict' >.gitattributes
-->8 conflict.pl 8<--
#!/usr/bin/perl
use strict;
use warnings qw(all FATAL);
my $fn1 = shift;
my $fn2 = shift;
open(my $diff, '-|', qw(diff -U 999999), $fn1, $fn2)
or die "unable to run diff: $!";
open(my $tmp, '>', "$fn1.tmp")
or die "unable to open temporary file: $!";
select $tmp;
while(<$diff>) {
last if /^@/;
}
sub start { print "<<<<<<< $fn1\n" }
sub divider { print "=======\n" }
sub end { print ">>>>>>> $fn2\n" }
my $conflict = 0;
while(<$diff>) {
if (/^ (.*)/) {
if ($conflict == 0) { }
elsif ($conflict == 1) { divider; end }
elsif ($conflict == 2) { end }
print $1, "\n";
$conflict = 0;
}
elsif(/^-(.*)/) {
if ($conflict == 0) { start }
elsif ($conflict == 1) { }
elsif ($conflict == 2) { end; start }
print $1, "\n";
$conflict = 1;
}
elsif(/^\+(.*)/) {
if ($conflict == 0) { start; divider }
elsif ($conflict == 1) { divider }
elsif ($conflict == 2) { }
print $1, "\n";
$conflict = 2;
}
}
if ($conflict == 0) { }
elsif ($conflict == 1) { divider; end }
elsif ($conflict == 2) { end }
close($tmp);
rename "$fn1.tmp", $fn1;
exit 1;
^ permalink raw reply
* Re: [PATCH] git-gui: Teach start_push_anywhere_action{} to notice when remote is a mirror.
From: Shawn O. Pearce @ 2008-12-02 15:30 UTC (permalink / raw)
To: Mark Burton; +Cc: git
In-Reply-To: <20081202151502.3f30ced4@crow>
Mark Burton <markb@ordern.com> wrote:
> When the destination repository is a mirror, this function goofed by still
> passing a refspec to git-push. Now it notices that the remote is a mirror
> and holds the refspec.
>
> Signed-off-by: Mark Burton <markb@ordern.com>
Thanks.
> This patch stops git-gui from annoying git-push when the remote is a
> mirror. A further enhancement would be to disable the branch names list
> in the dialog when the selected destination is a mirror. As it stands, you can
> select a branch name from the list but it will be ignored (this could possibly
> confuse/annoy people). But that's a bunch more work so I'm stopping here for
> now.
Yea, it is a chunk of work. I thought about trying to do it myself
right now, but realized I won't be able to do it in 15 minutes and
gave up. :-)
Unfortunately this patch adds a new string to be translated and I've
already made a request for the translators to update their languages,
and several have. I'll send out another request to let them know
there's this new string; we should have enough time before 1.6.1
goes final.
--
Shawn.
^ permalink raw reply
* Re: git-svn rebase "problems"
From: Peter Harris @ 2008-12-02 15:21 UTC (permalink / raw)
To: Joe Fiorini; +Cc: git
In-Reply-To: <73fd69b50812020656u3fd17015n267f694236982e5@mail.gmail.com>
On Tue, Dec 2, 2008 at 9:56 AM, Joe Fiorini wrote:
> Are there any other details I can provide to get an answer on this?
Maybe an actual script that reproduces the problem you're seeing?
> On Sun, Nov 30, 2008 at 10:17 PM, Joe Fiorini wrote:
>>
>> So I'm using git-svn. My team tends to commit to the svn server fairly
>> often. It has happened more than once that, because git svn rebase
>> applies each svn commit sequentially, some of the commits will
>> conflict with each other - whether or not I have ever touched the
>> file.
That sounds like you're "git pull"ing from each other, yes? I can't
imagine any other way you'd get conflicts on files you have never
touched.
>> Is there anything I could do to get around this without having to
>> merge code I'm unfamiliar with?
If the problem is that git-svn doesn't recognize git-svn commits that
have come from others via git-pull, you might be able to get away with
"rm -rf .git/svn" to force git-svn to rebuild its index. Git 1.6.1rc
or newer doesn't need this workaround, since it has incremental index
updating.
If the problem is that others' branches are conflicting with svn
checkins, switch back to your own branch so you're only rebasing your
own code, ask the person who wrote the other code to fix the
conflicts, and re-pull. This assumes a work-flow where you only ever
make commits on top of an un-merged state (which you pretty much have
to adopt anyway in a rebase-heavy environment such as one based on
git-svn).
Peter Harris
^ permalink raw reply
* [PATCH] git-gui: Teach start_push_anywhere_action{} to notice when remote is a mirror.
From: Mark Burton @ 2008-12-02 15:15 UTC (permalink / raw)
To: git
When the destination repository is a mirror, this function goofed by still
passing a refspec to git-push. Now it notices that the remote is a mirror
and holds the refspec.
Signed-off-by: Mark Burton <markb@ordern.com>
---
This patch stops git-gui from annoying git-push when the remote is a
mirror. A further enhancement would be to disable the branch names list
in the dialog when the selected destination is a mirror. As it stands, you can
select a branch name from the list but it will be ignored (this could possibly
confuse/annoy people). But that's a bunch more work so I'm stopping here for
now.
git-gui/lib/transport.tcl | 43 +++++++++++++++++++++++++++----------------
1 files changed, 27 insertions(+), 16 deletions(-)
diff --git a/git-gui/lib/transport.tcl b/git-gui/lib/transport.tcl
index e419d78..b18d9c7 100644
--- a/git-gui/lib/transport.tcl
+++ b/git-gui/lib/transport.tcl
@@ -33,10 +33,15 @@ proc push_to {remote} {
proc start_push_anywhere_action {w} {
global push_urltype push_remote push_url push_thin push_tags
global push_force
+ global repo_config
+ set is_mirror 0
set r_url {}
switch -- $push_urltype {
- remote {set r_url $push_remote}
+ remote {
+ set r_url $push_remote
+ catch {set is_mirror $repo_config(remote.$push_remote.mirror)}
+ }
url {set r_url $push_url}
}
if {$r_url eq {}} return
@@ -53,23 +58,29 @@ proc start_push_anywhere_action {w} {
lappend cmd --tags
}
lappend cmd $r_url
- set cnt 0
- foreach i [$w.source.l curselection] {
- set b [$w.source.l get $i]
- lappend cmd "refs/heads/$b:refs/heads/$b"
- incr cnt
- }
- if {$cnt == 0} {
- return
- } elseif {$cnt == 1} {
- set unit branch
+ if {$is_mirror} {
+ set cons [console::new \
+ [mc "push %s" $r_url] \
+ [mc "Mirroring to %s" $r_url]]
} else {
- set unit branches
- }
+ set cnt 0
+ foreach i [$w.source.l curselection] {
+ set b [$w.source.l get $i]
+ lappend cmd "refs/heads/$b:refs/heads/$b"
+ incr cnt
+ }
+ if {$cnt == 0} {
+ return
+ } elseif {$cnt == 1} {
+ set unit branch
+ } else {
+ set unit branches
+ }
- set cons [console::new \
- [mc "push %s" $r_url] \
- [mc "Pushing %s %s to %s" $cnt $unit $r_url]]
+ set cons [console::new \
+ [mc "push %s" $r_url] \
+ [mc "Pushing %s %s to %s" $cnt $unit $r_url]]
+ }
console::exec $cons $cmd
destroy $w
}
--
1.6.0.4
^ permalink raw reply related
* [PATCH] gitweb: Optional grouping of projects by category
From: Sebastien Cevey @ 2008-12-02 15:04 UTC (permalink / raw)
To: git; +Cc: jnareb, gitster, pasky
This adds the GITWEB_GROUP_CATEGORIES option which, if enabled, will
result in grouping projects by category on the project list page. The
category is specified for each project by the $GIT_DIR/category file
or the 'category' variable in its configuration file.
The feature is inspired from Sham Chukoury's patch for the XMMS2
gitweb, but has been rewritten for the current gitweb development
HEAD.
Thanks to Florian Ragwitz for Perl tips.
Signed-off-by: Sebastien Cevey <seb@cine7.net>
---
I submitted a previous version of this patch on July 27, but was told
to wait for the end of the feature freeze. I submitted it again on
September 5, but didn't get any reply. Hope to be luckier this time!
This is a new version of the patch, which has been rebased onto the
current HEAD of the master branch.
Makefile | 2 +
gitweb/README | 11 +++
gitweb/gitweb.css | 5 ++
gitweb/gitweb.perl | 173 +++++++++++++++++++++++++++++++++++-----------------
4 files changed, 135 insertions(+), 56 deletions(-)
diff --git a/Makefile b/Makefile
index 649cfb8..a8e8bbf 100644
--- a/Makefile
+++ b/Makefile
@@ -211,6 +211,7 @@ GITWEB_EXPORT_OK =
GITWEB_STRICT_EXPORT =
GITWEB_BASE_URL =
GITWEB_LIST =
+GITWEB_GROUP_CATEGORIES =
GITWEB_HOMETEXT = indextext.html
GITWEB_CSS = gitweb.css
GITWEB_LOGO = git-logo.png
@@ -1189,6 +1190,7 @@ gitweb/gitweb.cgi: gitweb/gitweb.perl
-e 's|++GITWEB_STRICT_EXPORT++|$(GITWEB_STRICT_EXPORT)|g' \
-e 's|++GITWEB_BASE_URL++|$(GITWEB_BASE_URL)|g' \
-e 's|++GITWEB_LIST++|$(GITWEB_LIST)|g' \
+ -e 's|++GITWEB_GROUP_CATEGORIES++|$(GITWEB_GROUP_CATEGORIES)|g' \
-e 's|++GITWEB_HOMETEXT++|$(GITWEB_HOMETEXT)|g' \
-e 's|++GITWEB_CSS++|$(GITWEB_CSS)|g' \
-e 's|++GITWEB_LOGO++|$(GITWEB_LOGO)|g' \
diff --git a/gitweb/README b/gitweb/README
index 825162a..a6f82c5 100644
--- a/gitweb/README
+++ b/gitweb/README
@@ -38,6 +38,11 @@ You can specify the following configuration variables when building GIT:
using gitweb" in INSTALL file for gitweb to find out how to generate
such file from scan of a directory. [No default, which means use root
directory for projects]
+ * GITWEB_GROUP_CATEGORIES
+ Groups projects by category on the main projects list page if set
+ to true. The category of a project is determined by the
+ $GIT_DIR/category file or the 'category' variable in its
+ configuration file. [No default / Not set]
* GITWEB_EXPORT_OK
Show repository only if this file exists (in repository). Only
effective if this variable evaluates to true. [No default / Not set]
@@ -188,6 +193,12 @@ not include variables usually directly set during build):
full description is available as 'title' attribute (usually shown on
mouseover). By default set to 25, which might be too small if you
use long project descriptions.
+ * $projects_list_group_categories
+ Enables the grouping of projects by category on the project list page.
+ * $project_list_default_category
+ Default category for projects for which none is specified. If set
+ to the empty string, such projects will remain uncategorized and
+ listed at the top, above categorized projects.
* @git_base_url_list
List of git base URLs used for URL to where fetch project from, shown
in project summary page. Full URL is "$git_base_url/$project".
diff --git a/gitweb/gitweb.css b/gitweb/gitweb.css
index a01eac8..2dd45d6 100644
--- a/gitweb/gitweb.css
+++ b/gitweb/gitweb.css
@@ -264,6 +264,11 @@ td.current_head {
text-decoration: underline;
}
+td.category {
+ padding-top: 1em;
+ font-weight: bold;
+}
+
table.diff_tree span.file_status.new {
color: #008000;
}
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 933e137..c1bcd96 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -87,6 +87,13 @@ our $projects_list = "++GITWEB_LIST++";
# the width (in characters) of the projects list "Description" column
our $projects_list_description_width = 25;
+# group projects by category on the projects list
+our $projects_list_group_categories = "++GITWEB_GROUP_CATEGORIES++";
+
+# default category if none specified
+# (leave the empty string for no category)
+our $project_list_default_category = "";
+
# default order of projects list
# valid values are none, project, descr, owner, and age
our $default_projects_order = "project";
@@ -2001,18 +2008,28 @@ sub git_get_path_by_hash {
## ......................................................................
## git utility functions, directly accessing git repository
-sub git_get_project_description {
- my $path = shift;
+sub git_get_project_config_from_file {
+ my ($name, $path) = @_;
$git_dir = "$projectroot/$path";
- open my $fd, "$git_dir/description"
- or return git_get_project_config('description');
- my $descr = <$fd>;
+ open my $fd, "$git_dir/$name"
+ or return git_get_project_config($name);
+ my $conf = <$fd>;
close $fd;
- if (defined $descr) {
- chomp $descr;
+ if (defined $conf) {
+ chomp $conf;
}
- return $descr;
+ return $conf;
+}
+
+sub git_get_project_description {
+ my $path = shift;
+ return git_get_project_config_from_file('description', $path);
+}
+
+sub git_get_project_category {
+ my $path = shift;
+ return git_get_project_config_from_file('category', $path);
}
sub git_get_project_ctags {
@@ -3907,8 +3924,9 @@ sub git_patchset_body {
# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-# fills project list info (age, description, owner, forks) for each
-# project in the list, removing invalid projects from returned list
+# fills project list info (age, description, owner, category, forks)
+# for each project in the list, removing invalid projects from
+# returned list
# NOTE: modifies $projlist, but does not remove entries from it
sub fill_project_list_info {
my ($projlist, $check_forks) = @_;
@@ -3931,6 +3949,11 @@ sub fill_project_list_info {
if (!defined $pr->{'owner'}) {
$pr->{'owner'} = git_get_project_owner("$pr->{'path'}") || "";
}
+ if ($projects_list_group_categories && !defined $pr->{'cat'}) {
+ my $cat = git_get_project_category($pr->{'path'}) ||
+ $project_list_default_category;
+ $pr->{'cat'} = to_utf8($cat);
+ }
if ($check_forks) {
my $pname = $pr->{'path'};
if (($pname =~ s/\.git$//) &&
@@ -3948,6 +3971,19 @@ sub fill_project_list_info {
return @projects;
}
+# returns a hash of categories, containing the list of project
+# belonging to each category
+sub build_category_list {
+ my ($projlist) = @_;
+ my %categories;
+
+ for my $pr (@{ $projlist }) {
+ push @{$categories{ $pr->{'cat'} }}, $pr;
+ }
+
+ return %categories;
+}
+
# print 'sort by' <th> element, generating 'sort by $name' replay link
# if that order is not selected
sub print_sort_th {
@@ -3964,59 +4000,17 @@ sub print_sort_th {
}
}
-sub git_project_list_body {
+sub print_project_rows {
# actually uses global variable $project
- my ($projlist, $order, $from, $to, $extra, $no_header) = @_;
-
- my ($check_forks) = gitweb_check_feature('forks');
- my @projects = fill_project_list_info($projlist, $check_forks);
+ my ($projects, $from, $to, $check_forks, $show_ctags) = @_;
- $order ||= $default_projects_order;
$from = 0 unless defined $from;
- $to = $#projects if (!defined $to || $#projects < $to);
+ $to = $#$projects if (!defined $to || $#$projects < $to);
- my %order_info = (
- project => { key => 'path', type => 'str' },
- descr => { key => 'descr_long', type => 'str' },
- owner => { key => 'owner', type => 'str' },
- age => { key => 'age', type => 'num' }
- );
- my $oi = $order_info{$order};
- if ($oi->{'type'} eq 'str') {
- @projects = sort {$a->{$oi->{'key'}} cmp $b->{$oi->{'key'}}} @projects;
- } else {
- @projects = sort {$a->{$oi->{'key'}} <=> $b->{$oi->{'key'}}} @projects;
- }
-
- my $show_ctags = gitweb_check_feature('ctags');
- if ($show_ctags) {
- my %ctags;
- foreach my $p (@projects) {
- foreach my $ct (keys %{$p->{'ctags'}}) {
- $ctags{$ct} += $p->{'ctags'}->{$ct};
- }
- }
- my $cloud = git_populate_project_tagcloud(\%ctags);
- print git_show_project_tagcloud($cloud, 64);
- }
-
- print "<table class=\"project_list\">\n";
- unless ($no_header) {
- print "<tr>\n";
- if ($check_forks) {
- print "<th></th>\n";
- }
- print_sort_th('project', $order, 'Project');
- print_sort_th('descr', $order, 'Description');
- print_sort_th('owner', $order, 'Owner');
- print_sort_th('age', $order, 'Last Change');
- print "<th></th>\n" . # for links
- "</tr>\n";
- }
my $alternate = 1;
my $tagfilter = $cgi->param('by_tag');
for (my $i = $from; $i <= $to; $i++) {
- my $pr = $projects[$i];
+ my $pr = $projects->[$i];
next if $tagfilter and $show_ctags and not grep { lc $_ eq lc $tagfilter } keys %{$pr->{'ctags'}};
next if $searchtext and not $pr->{'path'} =~ /$searchtext/
@@ -4060,6 +4054,73 @@ sub git_project_list_body {
"</td>\n" .
"</tr>\n";
}
+}
+
+sub git_project_list_body {
+ my ($projlist, $order, $from, $to, $extra, $no_header) = @_;
+
+ my ($check_forks) = gitweb_check_feature('forks');
+ my @projects = fill_project_list_info($projlist, $check_forks);
+
+ $order ||= $default_projects_order;
+
+ my %order_info = (
+ project => { key => 'path', type => 'str' },
+ descr => { key => 'descr_long', type => 'str' },
+ owner => { key => 'owner', type => 'str' },
+ age => { key => 'age', type => 'num' }
+ );
+ my $oi = $order_info{$order};
+ if ($oi->{'type'} eq 'str') {
+ @projects = sort {$a->{$oi->{'key'}} cmp $b->{$oi->{'key'}}} @projects;
+ } else {
+ @projects = sort {$a->{$oi->{'key'}} <=> $b->{$oi->{'key'}}} @projects;
+ }
+
+ my $show_ctags = gitweb_check_feature('ctags');
+ if ($show_ctags) {
+ my %ctags;
+ foreach my $p (@projects) {
+ foreach my $ct (keys %{$p->{'ctags'}}) {
+ $ctags{$ct} += $p->{'ctags'}->{$ct};
+ }
+ }
+ my $cloud = git_populate_project_tagcloud(\%ctags);
+ print git_show_project_tagcloud($cloud, 64);
+ }
+
+ print "<table class=\"project_list\">\n";
+ unless ($no_header) {
+ print "<tr>\n";
+ if ($check_forks) {
+ print "<th></th>\n";
+ }
+ print_sort_th('project', $order, 'Project');
+ print_sort_th('descr', $order, 'Description');
+ print_sort_th('owner', $order, 'Owner');
+ print_sort_th('age', $order, 'Last Change');
+ print "<th></th>\n" . # for links
+ "</tr>\n";
+ }
+
+ if ($projects_list_group_categories) {
+ my %categories = build_category_list(\@projects);
+ foreach my $cat (sort keys %categories) {
+ unless ($cat eq "") {
+ print "<tr>\n";
+ if ($check_forks) {
+ print "<td></td>\n";
+ }
+ print "<td class=\"category\" colspan=\"5\">$cat</td>\n";
+ print "</tr>\n";
+ }
+
+ print_project_rows($categories{$cat}, $from, $to, $check_forks, $show_ctags);
+ }
+ } else {
+ print_project_rows(\@projects, $from, $to, $check_forks, $show_ctags);
+ }
+
if (defined $extra) {
print "<tr>\n";
if ($check_forks) {
--
1.5.6.5
^ permalink raw reply related
* Re: git-svn rebase "problems"
From: Joe Fiorini @ 2008-12-02 14:56 UTC (permalink / raw)
To: git
In-Reply-To: <73fd69b50811301917j6535f289uf177976707914e46@mail.gmail.com>
Are there any other details I can provide to get an answer on this?
Thanks!
Joe
On Sun, Nov 30, 2008 at 10:17 PM, Joe Fiorini <joe@faithfulgeek.org> wrote:
> I'm having some problems with git svn rebase. I'm pretty sure this is
> just the way git works, not a problem per se. But it's causing trouble
> for me and my team.
> My team is currently on Subversion. I'm trying to convince some people
> that git is a good way to go.
>
> So I'm using git-svn. My team tends to commit to the svn server fairly
> often. It has happened more than once that, because git svn rebase
> applies each svn commit sequentially, some of the commits will
> conflict with each other - whether or not I have ever touched the
> file. Obviously, this is a big problem because if I've never touched
> the file, then I probably won't know exactly how to resolve the merge
> (the merge markers haven't been solely reliable).
>
> Is there anything I could do to get around this without having to
> merge code I'm unfamiliar with?
>
> Thanks all!
> Joe Fiorini
> --
> joe fiorini
> http://www.faithfulgeek.org
> // freelancing & knowledge sharing
>
--
joe fiorini
http://www.faithfulgeek.org
// freelancing & knowledge sharing
^ permalink raw reply
* [StGit PATCH] Print conflict details with the new infrastructure (bug #11181)
From: Catalin Marinas @ 2008-12-02 14:40 UTC (permalink / raw)
To: Karl Hasselström; +Cc: git
The patch modifies the IndexAndWorkTree.merge() function to display
pass the conflict information (files) when raising an exception. The
logic is similar to the one in the old infrastructure.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
---
stgit/lib/git.py | 14 +++++++++-----
stgit/lib/transaction.py | 8 +++++---
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/stgit/lib/git.py b/stgit/lib/git.py
index 0a208ef..6457893 100644
--- a/stgit/lib/git.py
+++ b/stgit/lib/git.py
@@ -829,12 +829,16 @@ class IndexAndWorktree(RunWithEnvCwd):
env = { 'GITHEAD_%s' % base.sha1: 'ancestor',
'GITHEAD_%s' % ours.sha1: 'current',
'GITHEAD_%s' % theirs.sha1: 'patched'})
- r.discard_output()
+ r.returns([0, 1])
+ output = r.output_lines()
+ if r.exitcode:
+ # There were conflicts
+ conflicts = [l for l in output if l.startswith('CONFLICT')]
+ err = '%d conflict(s)\n%s' \
+ % (len(conflicts), ''.join(conflicts))
+ raise MergeConflictException(err)
except run.RunException, e:
- if r.exitcode == 1:
- raise MergeConflictException()
- else:
- raise MergeException('Index/worktree dirty')
+ raise MergeException('Index/worktree dirty')
def changed_files(self, tree, pathlimits = []):
"""Return the set of files in the worktree that have changed with
respect to C{tree}. The listing is optionally restricted to
diff --git a/stgit/lib/transaction.py b/stgit/lib/transaction.py
index 0f414d8..b8e82b6 100644
--- a/stgit/lib/transaction.py
+++ b/stgit/lib/transaction.py
@@ -201,7 +201,8 @@ class StackTransaction(object):
self.__stack.set_head(new_head, self.__msg)
if self.__error:
- out.error(self.__error)
+ error_lines = self.__error.split('\n')
+ out.error(*error_lines)
# Write patches.
def write(msg):
@@ -311,9 +312,10 @@ class StackTransaction(object):
tree = iw.index.write_tree()
self.__current_tree = tree
s = ' (modified)'
- except git.MergeConflictException:
+ except git.MergeConflictException, e:
tree = ours
merge_conflict = True
+ conflict_error = str(e)
s = ' (conflict)'
except git.MergeException, e:
self.__halt(str(e))
@@ -344,7 +346,7 @@ class StackTransaction(object):
# Save this update so that we can run it a little later.
self.__conflicting_push = update
- self.__halt('Merge conflict')
+ self.__halt(conflict_error)
else:
# Update immediately.
update()
^ permalink raw reply related
* [StGit PATCH] Do not append a new line to the backwards compat files (bug #12656)
From: Catalin Marinas @ 2008-12-02 14:38 UTC (permalink / raw)
To: Karl Hasselström; +Cc: git
Since the multiline argument wasn't passed to the utils.write_string()
function when writing the compatibility description file from the new
infrastructure, any older command like push would have committed these
new lines.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
---
stgit/lib/stack.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/stgit/lib/stack.py b/stgit/lib/stack.py
index 47679b6..a72ee22 100644
--- a/stgit/lib/stack.py
+++ b/stgit/lib/stack.py
@@ -58,7 +58,7 @@ class Patch(object):
write('authdate', d.author.date)
write('commname', d.committer.name)
write('commemail', d.committer.email)
- write('description', d.message)
+ write('description', d.message, multiline = True)
write('log', write_patchlog().sha1)
write('top', new_commit.sha1)
write('bottom', d.parent.sha1)
^ permalink raw reply related
* Re: more merge strategies : feature request
From: Caleb Cushing @ 2008-12-02 14:28 UTC (permalink / raw)
To: Jeff King; +Cc: Andreas Ericsson, git
In-Reply-To: <20081202033013.GD6804@coredump.intra.peff.net>
>
> It's not clear to me exactly what you want. Let's say I have a file
> ....
I'm afraid I don't fully understand your example
lets say git merge foo bar
foo bar
1 1
2 8
3 3
4 4
5 5
6
7
lines 6 and 7 are new in foo line 2 has a conflict because the other
head has an 8, history wise because of an early merge the other
direction and fix, there was the 8 in foo and it was changed to a 2,
when I merge back it will overwrite the 8 with a 2. however I need
the 8 to be the 8 and the 2 to be the 2. but I want the 6 and 7 in
both.
conflict would create a conflict
such as
foo
1
<<<<<< bar
8
======
2
>>>>>> foo
3
4
5
6
7
no overwrite would result in file1 looking like this
1
8
3
4
5
6
7
> Did you want conflict markers in the resulting file? If so, what should
> the conflict markers look like, since there isn't actually a conflict?
if the the remote and local branches are not identical there's a
difference which should be able to result in a conflict. for all
purposes I'm not sure git couldn't just ignore the history of the
files and do a straight head to head merge. the steps you suggest
make it more complicated than it needs to be an if done post merge or
without merge will probably be need to be done again in a future merge
if merging back and forth
--
Caleb Cushing
^ permalink raw reply
* [PATCH 2/2 v2] Documentation: describe how to "bisect skip" a range of commits
From: Christian Couder @ 2008-12-02 13:53 UTC (permalink / raw)
To: Junio C Hamano, Johannes Schindelin, Johannes Sixt; +Cc: git, H. Peter Anvin
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
Documentation/git-bisect.txt | 21 ++++++++++++++++++++-
git-bisect.sh | 2 +-
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt
index 39034ec..147ea38 100644
--- a/Documentation/git-bisect.txt
+++ b/Documentation/git-bisect.txt
@@ -19,7 +19,7 @@ on the subcommand:
git bisect start [<bad> [<good>...]] [--] [<paths>...]
git bisect bad [<rev>]
git bisect good [<rev>...]
- git bisect skip [<rev>...]
+ git bisect skip [(<rev>|<range>)...]
git bisect reset [<branch>]
git bisect visualize
git bisect replay <logfile>
@@ -164,6 +164,25 @@ But computing the commit to test may be slower afterwards and git may
eventually not be able to tell the first bad among a bad and one or
more "skip"ped commits.
+You can even skip a range of commits, instead of just one commit,
+using the "'<commit1>'..'<commit2>'" notation. For example:
+
+------------
+$ git bisect skip v2.5..v2.6
+------------
+
+would mean that no commit between `v2.5` excluded and `v2.6` included
+can be tested.
+
+Note that if you want to also skip the first commit of a range you can
+use something like:
+
+------------
+$ git bisect skip v2.5 v2.5..v2.6
+------------
+
+and the commit pointed to by `v2.5` will be skipped too.
+
Cutting down bisection by giving more parameters to bisect start
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/git-bisect.sh b/git-bisect.sh
index ddbdba8..17a35f6 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -9,7 +9,7 @@ git bisect bad [<rev>]
mark <rev> a known-bad revision.
git bisect good [<rev>...]
mark <rev>... known-good revisions.
-git bisect skip [<rev>...]
+git bisect skip [(<rev>|<range>)...]
mark <rev>... untestable revisions.
git bisect next
find next bisection to test and check it out.
--
1.6.0.4.838.g4ea49
^ permalink raw reply related
* [PATCH 1/2 v2] bisect: fix "git bisect skip <commit>" and add tests cases
From: Christian Couder @ 2008-12-02 13:53 UTC (permalink / raw)
To: Junio C Hamano, Johannes Schindelin, Johannes Sixt; +Cc: git, H. Peter Anvin
The patch that allows "git bisect skip" to be passed a range of
commits using the "<commit1>..<commit2>" notation is flawed because
it introduces a regression when it was passed a simple rev or commit.
"git bisect skip <commit>" doesn't work any more, because <commit>
is quoted but not properly unquoted.
This patch fixes that and add tests cases to better check when it is
passed commits and range of commits.
While at it, this patch also properly quotes the non range arguments
using the "sq" function.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
git-bisect.sh | 4 ++--
t/t6030-bisect-porcelain.sh | 19 ++++++++++++++++++-
2 files changed, 20 insertions(+), 3 deletions(-)
Change since previous version: now properly quote any non
range argument using "sq" (in patch 1/2).
diff --git a/git-bisect.sh b/git-bisect.sh
index 6706bc1..ddbdba8 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -199,11 +199,11 @@ bisect_skip() {
*..*)
revs=$(git rev-list "$arg") || die "Bad rev input: $arg" ;;
*)
- revs="'$arg'" ;;
+ revs=$(sq "$arg") ;;
esac
all="$all $revs"
done
- bisect_state 'skip' $all
+ eval bisect_state 'skip' $all
}
bisect_state() {
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index 85fa39c..dd7eac8 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -313,8 +313,25 @@ test_expect_success 'bisect run & skip: find first bad' '
grep "$HASH6 is first bad commit" my_bisect_log.txt
'
-test_expect_success 'bisect starting with a detached HEAD' '
+test_expect_success 'bisect skip only one range' '
+ git bisect reset &&
+ git bisect start $HASH7 $HASH1 &&
+ git bisect skip $HASH1..$HASH5 &&
+ test "$HASH6" = "$(git rev-parse --verify HEAD)" &&
+ test_must_fail git bisect bad > my_bisect_log.txt &&
+ grep "first bad commit could be any of" my_bisect_log.txt
+'
+test_expect_success 'bisect skip many ranges' '
+ git bisect start $HASH7 $HASH1 &&
+ test "$HASH4" = "$(git rev-parse --verify HEAD)" &&
+ git bisect skip $HASH2 $HASH2.. ..$HASH5 &&
+ test "$HASH6" = "$(git rev-parse --verify HEAD)" &&
+ test_must_fail git bisect bad > my_bisect_log.txt &&
+ grep "first bad commit could be any of" my_bisect_log.txt
+'
+
+test_expect_success 'bisect starting with a detached HEAD' '
git bisect reset &&
git checkout master^ &&
HEAD=$(git rev-parse --verify HEAD) &&
--
1.6.0.4.838.g4ea49
^ permalink raw reply related
* Re: more merge strategies : feature request
From: Caleb Cushing @ 2008-12-02 13:46 UTC (permalink / raw)
To: SLONIK.AZ; +Cc: Andreas Ericsson, git
In-Reply-To: <ee2a733e0812011849l1b319c96u9abbb4e8dd4f53ce@mail.gmail.com>
> I guess that "no-overwrite" can be achieved by
>
> git merge -s ours --no-commit
no it doesn't. which is why I called it a bad name. no-overwrite would
still add new lines to the file not in ours (and no-commit isn't
needed in that case) it just wouldn't overwrite conflicting lines, my
understanding of ours is that it will keep the files as is.
Caleb Cushing
^ permalink raw reply
* Bugs in git-gui and git-push when pushing src:dst to mirror?
From: Mark Burton @ 2008-12-02 13:08 UTC (permalink / raw)
To: git
Hi,
Using git 1.6.0.4.
I just tried to push using git-gui to a mirror of the current
repository and it failed because git-gui included a src:dest refspec
and that upset git-push as the remote is a mirror. So, I think that it would
be useful if git-gui notices when the remote is a mirror and does not
pass the refspec (I shall try to form a patch later when I have some time).
The other issue is that although git-push did print the usage blurb,
it didn't actually produce a message saying what it's problem was.
Looking at the source, I would have expected to have seen "--mirror
can't be combined with refspecs" printed but it didn't happen. Here's
what I got when I run the same command (as attempted by git-gui) on the
command line:
$ git push -v tako refs/heads/multi-stream:refs/heads/multi-stream
usage: git push [--all | --mirror] [--dry-run] [--tags] [--receive-pack=<git-receive-pack>] [--repo=<repository>] [-f | --force] [-v] [<repository> <refspec>...]
-v, --verbose be verbose
--repo <repository> repository
--all push all refs
--mirror mirror all refs
--tags push tags
--dry-run dry run
-f, --force force updates
--thin use thin pack
--receive-pack <receive-pack>
receive pack program
--exec <receive-pack>
receive pack program
Any ideas?
Cheers,
Mark
^ permalink raw reply
* Re: [PATCH] t4030-diff-textconv: Make octal escape sequence more portable
From: Jeff King @ 2008-12-02 12:54 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Junio C Hamano, Git Mailing List
In-Reply-To: <4934F245.9020908@viscovery.net>
On Tue, Dec 02, 2008 at 09:31:01AM +0100, Johannes Sixt wrote:
> There are printfs around that do not grok '\1', but need '\01'.
> Discovered on AIX 4.3.x.
Whee. Your fix works fine on my platforms (Solaris + FreeBSD).
> I found no other instance of printf backslash-nonzero.
Me either.
-Peff
^ permalink raw reply
* Re: [PATCH] Add a built-in alias for 'stage' to the 'add' command
From: Nguyen Thai Ngoc Duy @ 2008-12-02 12:36 UTC (permalink / raw)
To: Scott Chacon; +Cc: gitster, git, peff
In-Reply-To: <20081202061455.GA48848@agadorsparticus>
On 12/2/08, Scott Chacon <schacon@gmail.com> wrote:
> diff --git a/git.c b/git.c
> index 89feb0b..9e5813c 100644
> --- a/git.c
> +++ b/git.c
> @@ -266,6 +266,7 @@ static void handle_internal_command(int argc, const char **argv)
> const char *cmd = argv[0];
> static struct cmd_struct commands[] = {
> { "add", cmd_add, RUN_SETUP | NEED_WORK_TREE },
> + { "stage", cmd_add, RUN_SETUP | NEED_WORK_TREE },
> { "annotate", cmd_annotate, RUN_SETUP },
> { "apply", cmd_apply },
> { "archive", cmd_archive },
Nit-picking. There are some references to "git add" in builtin-add.c,
like help usage or error message ("Maybe you wanted to say 'git add
.'?\n"). Should it refer to "git stage" instead as well?
--
Duy
^ permalink raw reply
* [PATCHv3bis] gitweb: fixes to gitweb feature check code
From: Giuseppe Bilotta @ 2008-12-02 10:43 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski, Petr Baudis, Junio C Hamano, Giuseppe Bilotta
In-Reply-To: <200812020253.09430.jnareb@gmail.com>
The gitweb_check_feature routine was being used for two different
purposes: retrieving the actual feature value (such as the list of
snapshot formats or the list of additional actions), and checking if a
feature was enabled.
This led to subtle bugs in feature checking code: gitweb_check_feature
would return (0) for disabled features, so its use in scalar context
would return true instead of false.
To fix this issue and future-proof the code, we split feature value
retrieval into its own gitweb_get_feature()function, and ensure that
the boolean feature check function gitweb_check_feature() always returns
a scalar (precisely, the first/only item in the feature value list).
Usage of gitweb_check_feature() across gitweb is replaced with
gitweb_get_feature() where appropriate, and list evaluation of
gitweb_check_feature() is demoted to scalar evaluation to prevent
ambiguity. The few previously incorrect uses of gitweb_check_feature()
in scalar context are left untouched because they are now correct.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
---
Fixed typo in commit message.
gitweb/gitweb.perl | 52 +++++++++++++++++++++++++++++++++++-----------------
1 files changed, 35 insertions(+), 17 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 933e137..4246819 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -190,7 +190,9 @@ our %feature = (
# if there is no 'sub' key (no feature-sub), then feature cannot be
# overriden
#
- # use gitweb_check_feature(<feature>) to check if <feature> is enabled
+ # use gitweb_get_feature(<feature>) to retrieve the <feature> value
+ # (an array) or gitweb_check_feature(<feature>) to check if <feature>
+ # is enabled
# Enable the 'blame' blob view, showing the last commit that modified
# each line in the file. This can be very CPU-intensive.
@@ -329,7 +331,8 @@ our %feature = (
'default' => [0]},
);
-sub gitweb_check_feature {
+# retrieve the value of a given feature, as an array
+sub gitweb_get_feature {
my ($name) = @_;
return unless exists $feature{$name};
my ($sub, $override, @defaults) = (
@@ -344,6 +347,21 @@ sub gitweb_check_feature {
return $sub->(@defaults);
}
+# check if a given feature is enabled or not, returning the first (and only)
+# value of the feature. This allows us to write
+# my $bool_feat = gitweb_check_feature('bool_feat');
+# or
+# gitweb_check_feature('bool_feat') or somecode;
+# instead of
+# my ($bool_feat) = gitweb_get_feature('bool_feat');
+# or
+# (gitweb_get_feature('bool_feat'))[0] or somecode;
+# respectively
+sub gitweb_check_feature {
+ return (gitweb_get_feature(@_))[0];
+}
+
+
sub feature_blame {
my ($val) = git_get_project_config('blame', '--bool');
@@ -767,7 +785,7 @@ our $git_dir;
$git_dir = "$projectroot/$project" if $project;
# list of supported snapshot formats
-our @snapshot_fmts = gitweb_check_feature('snapshot');
+our @snapshot_fmts = gitweb_get_feature('snapshot');
@snapshot_fmts = filter_snapshot_fmts(@snapshot_fmts);
# dispatch
@@ -810,7 +828,7 @@ sub href (%) {
}
}
- my ($use_pathinfo) = gitweb_check_feature('pathinfo');
+ my $use_pathinfo = gitweb_check_feature('pathinfo');
if ($use_pathinfo) {
# try to put as many parameters as possible in PATH_INFO:
# - project name
@@ -2101,7 +2119,7 @@ sub git_get_projects_list {
$filter ||= '';
$filter =~ s/\.git$//;
- my ($check_forks) = gitweb_check_feature('forks');
+ my $check_forks = gitweb_check_feature('forks');
if (-d $projects_list) {
# search in directory
@@ -2947,7 +2965,7 @@ EOF
}
print "</div>\n";
- my ($have_search) = gitweb_check_feature('search');
+ my $have_search = gitweb_check_feature('search');
if (defined $project && $have_search) {
if (!defined $searchtext) {
$searchtext = "";
@@ -2961,7 +2979,7 @@ EOF
$search_hash = "HEAD";
}
my $action = $my_uri;
- my ($use_pathinfo) = gitweb_check_feature('pathinfo');
+ my $use_pathinfo = gitweb_check_feature('pathinfo');
if ($use_pathinfo) {
$action .= "/".esc_url($project);
}
@@ -3084,7 +3102,7 @@ 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');
+ my @actions = gitweb_get_feature('actions');
my %repl = (
'%' => '%',
'n' => $project, # project name
@@ -3454,7 +3472,7 @@ sub is_patch_split {
sub git_difftree_body {
my ($difftree, $hash, @parents) = @_;
my ($parent) = $parents[0];
- my ($have_blame) = gitweb_check_feature('blame');
+ my $have_blame = gitweb_check_feature('blame');
print "<div class=\"list_head\">\n";
if ($#{$difftree} > 10) {
print(($#{$difftree} + 1) . " files changed:\n");
@@ -3968,7 +3986,7 @@ sub git_project_list_body {
# actually uses global variable $project
my ($projlist, $order, $from, $to, $extra, $no_header) = @_;
- my ($check_forks) = gitweb_check_feature('forks');
+ my $check_forks = gitweb_check_feature('forks');
my @projects = fill_project_list_info($projlist, $check_forks);
$order ||= $default_projects_order;
@@ -4428,7 +4446,7 @@ sub git_summary {
my @taglist = git_get_tags_list(16);
my @headlist = git_get_heads_list(16);
my @forklist;
- my ($check_forks) = gitweb_check_feature('forks');
+ my $check_forks = gitweb_check_feature('forks');
if ($check_forks) {
@forklist = git_get_projects_list($project);
@@ -4457,7 +4475,7 @@ sub git_summary {
}
# Tag cloud
- my $show_ctags = (gitweb_check_feature('ctags'))[0];
+ my $show_ctags = gitweb_check_feature('ctags');
if ($show_ctags) {
my $ctags = git_get_project_ctags($project);
my $cloud = git_populate_project_tagcloud($ctags);
@@ -4747,7 +4765,7 @@ sub git_blob {
$expires = "+1d";
}
- my ($have_blame) = gitweb_check_feature('blame');
+ my $have_blame = gitweb_check_feature('blame');
open my $fd, "-|", git_cmd(), "cat-file", "blob", $hash
or die_error(500, "Couldn't cat $file_name, $hash");
my $mimetype = blob_mimetype($fd, $file_name);
@@ -4840,7 +4858,7 @@ sub git_tree {
my $ref = format_ref_marker($refs, $hash_base);
git_header_html();
my $basedir = '';
- my ($have_blame) = gitweb_check_feature('blame');
+ my $have_blame = gitweb_check_feature('blame');
if (defined $hash_base && (my %co = parse_commit($hash_base))) {
my @views_nav = ();
if (defined $file_name) {
@@ -5838,7 +5856,7 @@ insensitive).</p>
<dt><b>commit</b></dt>
<dd>The commit messages and authorship information will be scanned for the given pattern.</dd>
EOT
- my ($have_grep) = gitweb_check_feature('grep');
+ my $have_grep = gitweb_check_feature('grep');
if ($have_grep) {
print <<EOT;
<dt><b>grep</b></dt>
@@ -5855,7 +5873,7 @@ EOT
<dt><b>committer</b></dt>
<dd>Name and e-mail of the committer and date of commit will be scanned for the given pattern.</dd>
EOT
- my ($have_pickaxe) = gitweb_check_feature('pickaxe');
+ my $have_pickaxe = gitweb_check_feature('pickaxe');
if ($have_pickaxe) {
print <<EOT;
<dt><b>pickaxe</b></dt>
@@ -5907,7 +5925,7 @@ sub git_shortlog {
sub git_feed {
my $format = shift || 'atom';
- my ($have_blame) = gitweb_check_feature('blame');
+ my $have_blame = gitweb_check_feature('blame');
# Atom: http://www.atomenabled.org/developers/syndication/
# RSS: http://www.notestips.com/80256B3A007F2692/1/NAMO5P9UPQ
--
1.5.6.5
^ permalink raw reply related
* Re: Git as a BuildRequires (packaging)
From: Miklos Vajna @ 2008-12-02 10:12 UTC (permalink / raw)
To: Jeff King; +Cc: Josh Boyer, git, skvidal
In-Reply-To: <20081202030922.GC6804@coredump.intra.peff.net>
[-- Attachment #1: Type: text/plain, Size: 886 bytes --]
On Mon, Dec 01, 2008 at 10:09:23PM -0500, Jeff King <peff@peff.net> wrote:
> > So, what do the git gurus recommend? I'm not sure if other
> > distros have tackled this problem before, but some kind of
> > commonality for the 'how do you package things that need to build
> > against git' question would be nice.
>
> AFAIK, cgit is the only program that behaves in this way, and it doesn't
> seem to be in Debian at all. So you might be the first to deal with it.
> :)
We have it in Frugalware[1], and it's not a that big problem: the cgit
Makefile clearly states the supported git version, you just have to
download it "manually" (specify it in the spec file in case of Fedora)
in case you want an offline build (what every distro wants).
1: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=blob;f=source/network-extra/cgit/FrugalBuild;hb=HEAD
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: A better approach to diffing and merging
From: Karl Hasselström @ 2008-12-02 8:37 UTC (permalink / raw)
To: Jakub Narebski; +Cc: Ian Clarke, git
In-Reply-To: <m3y6z0i0mu.fsf@localhost.localdomain>
On 2008-12-01 03:41:38 -0800, Jakub Narebski wrote:
> Third, it would require embedding knowledge about various programming
> languages (including C, shell, Perl, TeX) and document formats
> (including XML, HTML, AsciiDoc) in version control system...
Really? I was under the impression that you could specify external
diff and merge programs in .gitattributes, which would be precisely
the right way to hook this stuff into git.
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle
^ permalink raw reply
* [PATCH] t4030-diff-textconv: Make octal escape sequence more portable
From: Johannes Sixt @ 2008-12-02 8:31 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jeff King, Git Mailing List
From: Johannes Sixt <j6t@kdbg.org>
There are printfs around that do not grok '\1', but need '\01'.
Discovered on AIX 4.3.x.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
I found no other instance of printf backslash-nonzero.
t/t4030-diff-textconv.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/t/t4030-diff-textconv.sh b/t/t4030-diff-textconv.sh
index 03ba26a..4e961df 100755
--- a/t/t4030-diff-textconv.sh
+++ b/t/t4030-diff-textconv.sh
@@ -29,7 +29,7 @@ test_expect_success 'setup binary file with history' '
printf "\\0\\n" >file &&
git add file &&
git commit -m one &&
- printf "\\1\\n" >>file &&
+ printf "\\01\\n" >>file &&
git add file &&
git commit -m two
'
--
1.6.1.rc1.5.gf691f
^ permalink raw reply related
* Re: [TOPGIT] Resolving conflicts
From: martin f krafft @ 2008-12-02 7:49 UTC (permalink / raw)
To: git; +Cc: Uwe Kleine-König, Sascha Hauer, Petr Baudis
In-Reply-To: <20081201143640.GA17818@cassiopeia.tralala>
[-- Attachment #1: Type: text/plain, Size: 980 bytes --]
also sprach Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [2008.12.01.1536 +0100]:
> > Another thing is that the exported branch contains an empty commit
> > resulting from t/whatever (and a corresponding empty patch when exported
> > as a quilt series)
> I fixed one half of this in with a patch sent to the ML:
>
> http://article.gmane.org/gmane.comp.version-control.git/101728
>
> it didn't made it upstream yet, though.
This is now in HEAD. Sorry for the delay.
--
.''`. martin f. krafft <madduck@d.o> Related projects:
: :' : proud Debian developer http://debiansystem.info
`. `'` http://people.debian.org/~madduck http://vcs-pkg.org
`- Debian - when you have better things to do than fixing systems
"i like wagner's music better than anybody's. it is so loud that one
can talk the whole time without other people hearing what one says."
-- oscar wilde
[-- Attachment #2: Digital signature (see http://martin-krafft.net/gpg/) --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: [PATCH] Makefile: introduce NO_PTHREADS
From: Johannes Sixt @ 2008-12-02 7:41 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Mike Ralphson
In-Reply-To: <1228148005-9404-1-git-send-email-mike@abacus.co.uk>
Mike Ralphson schrieb:
> From: Junio C Hamano <gitster@pobox.com>
>
> This introduces make variable NO_PTHREADS for platforms that lack the
> support for pthreads library or people who do not want to use it for
> whatever reason. When defined, it makes the multi-threaded index
> preloading into a no-op, and also disables threaded delta searching by
> pack-objects.
>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
> Signed-off-by: Mike Ralphson <mike@abacus.co.uk>
> ---
You can add
Tested-by: Johannes Sixt <j6t@kdbg.org> (AIX 4.3.x)
-- Hannes
^ permalink raw reply
* [PATCH] Add a built-in alias for 'stage' to the 'add' command
From: Scott Chacon @ 2008-12-02 6:14 UTC (permalink / raw)
To: gitster; +Cc: git, peff
This comes from conversation at the GitTogether where we thought it would
be helpful to be able to teach people to 'stage' files because it tends
to cause confusion when told that they have to keep 'add'ing them.
This continues the movement to start referring to the index as a
staging area (eg: the --staged alias to 'git diff'). Also adds a
doc file for 'git stage' that basically points to the docs for
'git add'.
Signed-off-by: Scott Chacon <schacon@gmail.com>
---
I changed the tense of a few things in the commit message and modified
the help file to be simpler.
Documentation/git-stage.txt | 19 +++++++++++++++++++
git.c | 1 +
2 files changed, 20 insertions(+), 0 deletions(-)
create mode 100644 Documentation/git-stage.txt
diff --git a/Documentation/git-stage.txt b/Documentation/git-stage.txt
new file mode 100644
index 0000000..7f251a5
--- /dev/null
+++ b/Documentation/git-stage.txt
@@ -0,0 +1,19 @@
+git-stage(1)
+==============
+
+NAME
+----
+git-stage - Add file contents to the staging area
+
+
+SYNOPSIS
+--------
+[verse]
+'git stage' args...
+
+
+DESCRIPTION
+-----------
+
+This is a synonym for linkgit:git-add[1]. Please refer to the
+documentation of that command.
diff --git a/git.c b/git.c
index 89feb0b..9e5813c 100644
--- a/git.c
+++ b/git.c
@@ -266,6 +266,7 @@ static void handle_internal_command(int argc, const char **argv)
const char *cmd = argv[0];
static struct cmd_struct commands[] = {
{ "add", cmd_add, RUN_SETUP | NEED_WORK_TREE },
+ { "stage", cmd_add, RUN_SETUP | NEED_WORK_TREE },
{ "annotate", cmd_annotate, RUN_SETUP },
{ "apply", cmd_apply },
{ "archive", cmd_archive },
--
1.6.0.8.gc9c8
^ permalink raw reply related
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