* Re: confusion over the new branch and merge config
From: Jakub Narebski @ 2007-01-03 23:02 UTC (permalink / raw)
To: Santi Béjar; +Cc: git
In-Reply-To: <8aa486160701021624v69015fbibb81a99177dd7dfc@mail.gmail.com>
Santi Béjar wrote:
> On 1/2/07, Jakub Narebski <jnareb@gmail.com> wrote:
>> Junio C Hamano wrote:
>>
>>> Obviously, the local names should matter more when you are doing
>>> local operations. So if you are using mergeLocal to give a
>>> shorthand to "git merge" that does not explicitly say what to
>>> merge, the above discussion does not apply. But if that is the
>>> case, mergeLocal should also not affect the selection of
>>> branches to be merged when "git pull" happens from a remote
>>> either.
>>
>> You can always use remote = ".", and then remote and local branches
>> are the same...
>
> Currently it does not work.
Fact.
I remember that there was proposal of having branch.<name>.remote=.
and branch.<name>.merge=<ref> to make "git pull" on branch <name>
do "git pull . <ref>". There was some discussion about this; perhaps
it was not accepted (or forgotten to be accepted after resolving
discussion).
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: [PATCH] gitweb: Fix "Use of uninitialized value" warning in git_tags_body
From: Jakub Narebski @ 2007-01-03 22:11 UTC (permalink / raw)
To: git
In-Reply-To: <11678612691404-git-send-email-jnareb@gmail.com>
Jakub Narebski wrote:
> Fix "Use of uninitialized value" warning in git_tags_body generated
> for lightweight tags of tree and blob object; those don't have age
> ($tag{'age'}) defined.
By the way, the latest "Fix warnings" patches for gitweb were result
of working on bare bones test suite for gitweb. For now I'm only
checking if there was anything written to STDERR.
BTW how in portable way to check that given file matches given patterns
in specified order, or matches given patterns in any order?
Below current version of script.
#!/bin/sh
#
# Copyright (c) 2007 Jakub Narebski
#
test_description='gitweb as standalone script (basic tests).
This test runs gitweb (git web interface) as CGI script from
commandline, and checks that it does not spew any errors
or warnings.'
gitweb_init () {
cat >gitweb_config.perl <<EOF
#!/usr/bin/perl
# gitweb configuration for tests
our \$version = "current";
our \$GIT = "git";
our \$projectroot = "$(pwd)";
our \$home_link_str = "projects";
our \$site_name = "[localhost]";
our \$site_header = "";
our \$site_footer = "";
our \$home_text = "indextext.html";
our @stylesheets = ("file:///$(pwd)/../../gitweb/gitweb.css");
our \$logo = "file:///$(pwd)/../../gitweb/git-logo.png";
our \$favicon = "file:///$(pwd)/../../gitweb/git-favicon.png";
our \$projects_list = "";
our \$export_ok = "";
our \$strict_export = "";
EOF
}
gitweb_run () {
export GATEWAY_INTERFACE="CGI/1.1"
export HTTP_ACCEPT="*/*"
export REQUEST_METHOD="GET"
export QUERY_STRING=""$1""
export PATH_INFO=""$2""
export GITWEB_CONFIG=$(pwd)/gitweb_config.perl
rm -f gitweb.log &&
perl -- $(pwd)/../../gitweb/gitweb.perl \
>/dev/null 2>gitweb.log &&
test ! -s gitweb.log
}
. ./test-lib.sh
gitweb_init
#test_debug 'cat $(pwd)/gitweb_config.perl'
# ----------------------------------------------------------------------
# no commits
test_expect_success \
'no commits: projects_list (implicit)' \
'gitweb_run'
test_debug 'cat gitweb.log'
test_expect_success \
'no commits: projects_index' \
'gitweb_run "a=project_index"'
test_debug 'cat gitweb.log'
test_expect_success \
'no commits: .git summary (implicit)' \
'gitweb_run "p=.git"'
test_debug 'cat gitweb.log'
test_expect_success \
'no commits: .git commit (implicit)' \
'gitweb_run "p=.git;a=commit"'
test_debug 'cat gitweb.log'
test_expect_success \
'no commits: .git tree (implicit)' \
'gitweb_run "p=.git;a=tree"'
test_debug 'cat gitweb.log'
test_expect_success \
'no commits: .git heads (implicit)' \
'gitweb_run "p=.git;a=heads"'
test_debug 'cat gitweb.log'
test_expect_success \
'no commits: .git tags (implicit)' \
'gitweb_run "p=.git;a=tags"'
test_debug 'cat gitweb.log'
# ----------------------------------------------------------------------
# initial commit
test_expect_success \
'make initial commit' \
'echo "Not an empty file." > file &&
git add file &&
git commit -a -m "Initial commit."'
test_expect_success \
'projects_list (implicit)' \
'gitweb_run'
test_debug 'cat gitweb.log'
test_expect_success \
'projects_index' \
'gitweb_run "a=project_index"'
test_debug 'cat gitweb.log'
test_expect_success \
'.git summary (implicit)' \
'gitweb_run "p=.git"'
test_debug 'cat gitweb.log'
test_expect_success \
'.git commit (implicit)' \
'gitweb_run "p=.git;a=commit"'
test_debug 'cat gitweb.log'
test_expect_success \
'.git commitdiff (implicit)' \
'gitweb_run "p=.git;a=commitdiff"'
test_debug 'cat gitweb.log'
test_expect_success \
'.git commit (HEAD)' \
'gitweb_run "p=.git;a=commit;h=HEAD"'
test_debug 'cat gitweb.log'
test_expect_success \
'.git commit (..invalid^..)' \
'gitweb_run "p=.git;a=commit;h=..invalid^.."'
test_debug 'cat gitweb.log'
test_expect_success \
'.git commit (non-existent)' \
'gitweb_run "p=.git;a=commit;h=non-existent"'
test_debug 'cat gitweb.log'
test_expect_success \
'.git tree (implicit)' \
'gitweb_run "p=.git;a=tree"'
test_debug 'cat gitweb.log'
test_expect_success \
'.git tree (0000000000000000000000000000000000000000)' \
'gitweb_run "p=.git;a=tree;h=0000000000000000000000000000000000000000"'
test_debug 'cat gitweb.log'
test_expect_success \
'.git blob (file)' \
'gitweb_run "p=.git;a=blob;f=file"'
test_debug 'cat gitweb.log'
test_expect_success \
'.git blob_plain (file)' \
'gitweb_run "p=.git;a=blob_plain;f=file"'
test_debug 'cat gitweb.log'
test_expect_success \
'.git blob (non-existent)' \
'gitweb_run "p=.git;a=blob;f=non-existent"'
test_debug 'cat gitweb.log'
# ----------------------------------------------------------------------
# commitdiff testing
test_expect_success \
'commitdiff: root' \
'gitweb_run "p=.git;a=commitdiff"'
test_debug 'cat gitweb.log'
test_expect_success \
'commitdiff: file added' \
'echo "New file" > new_file &&
git add new_file &&
git commit -a -m "File added." &&
gitweb_run "p=.git;a=commitdiff"'
test_debug 'cat gitweb.log'
test_expect_success \
'commitdiff: mode change' \
'chmod a+x new_file &&
git commit -a -m "Mode changed." &&
gitweb_run "p=.git;a=commitdiff"'
test_debug 'cat gitweb.log'
test_expect_success \
'commitdiff: file renamed' \
'git mv new_file renamed_file &&
git commit -a -m "File renamed." &&
gitweb_run "p=.git;a=commitdiff"'
test_debug 'cat gitweb.log'
test_expect_success \
'commitdiff: file to symlink' \
'rm renamed_file &&
ln -s file renamed_file &&
git commit -a -m "File to symlink." &&
gitweb_run "p=.git;a=commitdiff"'
test_debug 'cat gitweb.log'
test_expect_success \
'commitdiff: file deleted' \
'git rm renamed_file &&
rm -f renamed_file &&
git commit -a -m "File removed." &&
gitweb_run "p=.git;a=commitdiff"'
test_debug 'cat gitweb.log'
test_expect_success \
'commitdiff: file copied / new file' \
'cp file file2 &&
git add file2 &&
git commit -a -m "File copied." &&
gitweb_run "p=.git;a=commitdiff"'
test_debug 'cat gitweb.log'
test_expect_success \
'commitdiff: mode change and modified' \
'echo "New line" >> file2 &&
chmod a+x file2 &&
git commit -a -m "Mode change and modification." &&
gitweb_run "p=.git;a=commitdiff"'
test_debug 'cat gitweb.log'
test_expect_success \
'commitdiff: renamed and modified' \
'cat >file2<<EOF &&
Dominus regit me,
et nihil mihi deerit.
In loco pascuae ibi me collocavit,
super aquam refectionis educavit me;
animam meam convertit,
deduxit me super semitas jusitiae,
propter nomen suum.
EOF
git commit -a -m "File added." &&
git mv file2 file3 &&
echo "Propter nomen suum." >> file3 &&
git commit -a -m "File rename and modification." &&
gitweb_run "p=.git;a=commitdiff"'
test_debug 'cat gitweb.log'
test_expect_success \
'commitdiff: renamed, mode change and modified' \
'git mv file3 file2 &&
echo "Propter nomen suum." >> file2 &&
chmod a+x file2 &&
git commit -a -m "File rename, mode change and modification." &&
gitweb_run "p=.git;a=commitdiff"'
test_debug 'cat gitweb.log'
# ----------------------------------------------------------------------
# tags testing
test_expect_success \
'tags: different types of tags' \
'git tag -a -m "Tag commit object" tag-commit HEAD &&
git tag -a -m "Tag tag object" tag-tag tag-commit &&
git tag -a -m "Tag tree object" tag-tree HEAD^{tree} &&
git tag -a -m "Tag blob object" tag-blob HEAD:file &&
git tag lightweight/tag-commit HEAD &&
git tag lightweight/tag-tag tag-commit &&
git tag lightweight/tag-tree HEAD^{tree} &&
git tag lightweight/tag-blob HEAD:file &&
gitweb_run "p=.git;a=tags"'
test_debug 'cat gitweb.log'
test_done
^ permalink raw reply
* Re: [RFC] git-remote
From: Jakub Narebski @ 2007-01-03 22:05 UTC (permalink / raw)
To: git
In-Reply-To: <7vfyarokk7.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
> +elsif ($ARGV[0] eq 'add') {
> + if (@ARGV != 3) {
> + print STDERR "Usage: git remote show <name> <url>\n";
I think you meant to write here "Usage: git remote add <name> <url>\n";
("add" instead of "show").
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* [PATCH] gitweb: Fix "Use of uninitialized value" warning in git_tags_body
From: Jakub Narebski @ 2007-01-03 21:54 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski
Fix "Use of uninitialized value" warning in git_tags_body generated
for lightweight tags of tree and blob object; those don't have age
($tag{'age'}) defined.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
gitweb/gitweb.perl | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 2179054..fd671f3 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2813,8 +2813,12 @@ sub git_tags_body {
print "<tr class=\"light\">\n";
}
$alternate ^= 1;
- print "<td><i>$tag{'age'}</i></td>\n" .
- "<td>" .
+ if (defined $tag{'age'}) {
+ print "<td><i>$tag{'age'}</i></td>\n";
+ } else {
+ print "<td></td>\n";
+ }
+ print "<td>" .
$cgi->a({-href => href(action=>$tag{'reftype'}, hash=>$tag{'refid'}),
-class => "list name"}, esc_html($tag{'name'})) .
"</td>\n" .
--
1.4.4.3
^ permalink raw reply related
* [RFC] git-remote
From: Junio C Hamano @ 2007-01-03 21:40 UTC (permalink / raw)
To: git
It might be handy to have a single command that helps you manage
your configuration that relates to downloading from remote
repositories. This currently does only about 20% of what I want
it to do.
$ git remote
shows the list of 'remotes' you have defined somewhere, and
$ git remote origin
shows the details about the named remote (in this case
"origin"). How the branches are tracked, if you have a
tracking branch that is stale, etc.
$ git add another git://git.kernel.org/pub/...
defines the default remote.another.url and remote.another.fetch
entries just like a clone does; you can say "git fetch another"
afterwards.
For it to be useful, I think it should be enhanced to:
- check overlaps of tracking branches and warn;
- offer to remove stale tracking branches in one go;
- offer ways to remove or rename remote;
- give different levels of verbosity in its 'show' command,
especially if ls-remote is run;
- offer ways to update an existing remote, perhaps have an
interactive mode;
Other enhancements might be also possible, but I do not think of
anything that is absolutely necessary other than the above right
now.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
Makefile | 2 +-
git-remote.perl | 260 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 261 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index fa1a022..ea07634 100644
--- a/Makefile
+++ b/Makefile
@@ -179,7 +179,7 @@ SCRIPT_SH = \
SCRIPT_PERL = \
git-add--interactive.perl \
git-archimport.perl git-cvsimport.perl git-relink.perl \
- git-cvsserver.perl \
+ git-cvsserver.perl git-remote.perl \
git-svnimport.perl git-cvsexportcommit.perl \
git-send-email.perl git-svn.perl
diff --git a/git-remote.perl b/git-remote.perl
new file mode 100755
index 0000000..b0ec838
--- /dev/null
+++ b/git-remote.perl
@@ -0,0 +1,260 @@
+#!/usr/bin/perl -w
+
+use Git;
+my $git = Git->repository();
+
+sub add_remote_config {
+ my ($hash, $name, $what, $value) = @_;
+ if ($what eq 'url') {
+ if (exists $hash->{$name}{'URL'}) {
+ print STDERR "Warning: more than one remote.$name.url\n";
+ }
+ $hash->{$name}{'URL'} = $value;
+ }
+ elsif ($what eq 'fetch') {
+ $hash->{$name}{'FETCH'} ||= [];
+ push @{$hash->{$name}{'FETCH'}}, $value;
+ }
+ if (!exists $hash->{$name}{'SOURCE'}) {
+ $hash->{$name}{'SOURCE'} = 'config';
+ }
+}
+
+sub add_remote_remotes {
+ my ($hash, $file, $name) = @_;
+
+ if (exists $hash->{$name}) {
+ $hash->{$name}{'WARNING'} = 'ignored due to config';
+ return;
+ }
+
+ my $fh;
+ if (!open($fh, '<', $file)) {
+ print STDERR "Warning: cannot open $file\n";
+ return;
+ }
+ my $it = { 'SOURCE' => 'remotes' };
+ $hash->{$name} = $it;
+ while (<$fh>) {
+ chomp;
+ if (/^URL:\s*(.*)$/) {
+ # Having more than one is Ok -- it is used for push.
+ if (! exists $it->{'URL'}) {
+ $it->{'URL'} = $1;
+ }
+ }
+ elsif (/^Push:\s*(.*)$/) {
+ ; # later
+ }
+ elsif (/^Pull:\s*(.*)$/) {
+ $it->{'FETCH'} ||= [];
+ push @{$it->{'FETCH'}}, $1;
+ }
+ elsif (/^\#/) {
+ ; # ignore
+ }
+ else {
+ print STDERR "Warning: funny line in $file: $_\n";
+ }
+ }
+ close($fh);
+}
+
+sub list_remote {
+ my ($git) = @_;
+ my %seen = ();
+
+ for ($git->command(qw(repo-config --get-regexp), '^remote\.')) {
+ if (/^remote\.([^.]*)\.(\S*)\s+(.*)$/) {
+ add_remote_config(\%seen, $1, $2, $3);
+ }
+ }
+
+ my $dir = $git->repo_path() . "/remotes";
+ if (opendir(my $dh, $dir)) {
+ local $_;
+ while ($_ = readdir($dh)) {
+ chomp;
+ next if (! -f "$dir/$_" || ! -r _);
+ add_remote_remotes(\%seen, "$dir/$_", $_);
+ }
+ }
+
+ return \%seen;
+}
+
+sub add_branch_config {
+ my ($hash, $name, $what, $value) = @_;
+ if ($what eq 'remote') {
+ if (exists $hash->{$name}{'REMOTE'}) {
+ print STDERR "Warning: more than one branch.$name.remote\n";
+ }
+ $hash->{$name}{'REMOTE'} = $value;
+ }
+ elsif ($what eq 'merge') {
+ $hash->{$name}{'MERGE'} ||= [];
+ push @{$hash->{$name}{'MERGE'}}, $value;
+ }
+}
+
+sub list_branch {
+ my ($git) = @_;
+ my %seen = ();
+ for ($git->command(qw(repo-config --get-regexp), '^branch\.')) {
+ if (/^branch\.([^.]*)\.(\S*)\s+(.*)$/) {
+ add_branch_config(\%seen, $1, $2, $3);
+ }
+ }
+
+ return \%seen;
+}
+
+my $remote = list_remote($git);
+my $branch = list_branch($git);
+
+sub update_ls_remote {
+ my ($harder, $info) = @_;
+
+ return if (($harder == 0) ||
+ (($harder == 1) && exists $info->{'LS_REMOTE'}));
+
+ my @ref = map {
+ s|^[0-9a-f]{40}\s+refs/heads/||;
+ $_;
+ } $git->command(qw(ls-remote --heads), $info->{'URL'});
+ $info->{'LS_REMOTE'} = \@ref;
+}
+
+sub show_wildcard_mapping {
+ my ($forced, $ours, $ls) = @_;
+ my %refs;
+ for (@$ls) {
+ $refs{$_} = 01; # bit #0 to say "they have"
+ }
+ for ($git->command('for-each-ref', "refs/remotes/$ours")) {
+ chomp;
+ next unless (s|^[0-9a-f]{40}\s[a-z]+\srefs/remotes/$ours/||);
+ next if ($_ eq 'HEAD');
+ $refs{$_} ||= 0;
+ $refs{$_} |= 02; # bit #1 to say "we have"
+ }
+ my (@new, @stale, @tracked);
+ for (sort keys %refs) {
+ my $have = $refs{$_};
+ if ($have == 1) {
+ push @new, $_;
+ }
+ elsif ($have == 2) {
+ push @stale, $_;
+ }
+ elsif ($have == 3) {
+ push @tracked, $_;
+ }
+ }
+ if (@new) {
+ print " New remote branches (next fetch will store in remotes/$ours)\n";
+ print " @new\n";
+ }
+ if (@stale) {
+ print " Stale tracking branches in remotes/$ours (you'd better remove them)\n";
+ print " @stale\n";
+ }
+ if (@tracked) {
+ print " Tracked remote branches\n";
+ print " @tracked\n";
+ }
+}
+
+sub show_mapping {
+ my ($name, $info) = @_;
+ my $fetch = $info->{'FETCH'};
+ my $ls = $info->{'LS_REMOTE'};
+ my (@stale, @tracked);
+
+ for (@$fetch) {
+ next unless (/(\+)?([^:]+):(.*)/);
+ my ($forced, $theirs, $ours) = ($1, $2, $3);
+ if ($theirs eq 'refs/heads/*' &&
+ $ours =~ /^refs\/remotes\/(.*)\/\*$/) {
+ # wildcard mapping
+ show_wildcard_mapping($forced, $1, $ls);
+ }
+ elsif ($theirs =~ /\*/ || $ours =~ /\*/) {
+ print STDERR "Warning: unrecognized mapping in remotes.$name.fetch: $_\n";
+ }
+ elsif ($theirs =~ s|^refs/heads/||) {
+ if (!grep { $_ eq $theirs } @$ls) {
+ push @stale, $theirs;
+ }
+ elsif ($ours ne '') {
+ push @tracked, $theirs;
+ }
+ }
+ }
+ if (@stale) {
+ print " Stale tracking branches in remotes/$name (you'd better remove them)\n";
+ print " @stale\n";
+ }
+ if (@tracked) {
+ print " Tracked remote branches\n";
+ print " @tracked\n";
+ }
+}
+
+sub show_remote {
+ my ($name, $ls_remote) = @_;
+ if (!exists $remote->{$name}) {
+ print STDERR "No such remote $name\n";
+ return;
+ }
+ my $info = $remote->{$name};
+ update_ls_remote($ls_remote, $info);
+
+ print "* remote $name\n";
+ print " URL: $info->{'URL'}\n";
+ for my $branchname (sort keys %$branch) {
+ next if ($branch->{$branchname}{'REMOTE'} ne $name);
+ my @merged = map {
+ s|^refs/heads/||;
+ $_;
+ } split(' ',"@{$branch->{$branchname}{'MERGE'}}");
+ next unless (@merged);
+ print " Remote branch(es) merged with 'git pull' while on branch $branchname\n";
+ print " @merged\n";
+ }
+ if ($info->{'LS_REMOTE'}) {
+ show_mapping($name, $info);
+ }
+}
+
+sub add_remote {
+ my ($name, $url) = @_;
+ if (exists $remote->{$name}) {
+ print STDERR "remote $name already exists.\n";
+ exit(1);
+ }
+ $git->command('repo-config', "remote.$name.url", $url);
+ $git->command('repo-config', "remote.$name.fetch",
+ "+refs/heads/*:refs/remotes/$name/*");
+}
+
+if (!@ARGV) {
+ for (sort keys %$remote) {
+ print "$_\n";
+ }
+}
+elsif ($ARGV[0] eq 'show') {
+ if (@ARGV != 2) {
+ print STDERR "Usage: git remote show <remote>\n";
+ exit(1);
+ }
+ show_remote($ARGV[1], 1);
+}
+elsif ($ARGV[0] eq 'add') {
+ if (@ARGV != 3) {
+ print STDERR "Usage: git remote show <name> <url>\n";
+ exit(1);
+ }
+ add_remote($ARGV[1], $ARGV[2]);
+}
+
--
1.5.0.rc0.gcc26
^ permalink raw reply related
* [ANNOUNCE] Guilt 0.15
From: Josef Sipek @ 2007-01-03 20:37 UTC (permalink / raw)
To: git
Guilt (Git Quilt, formerly Git Queues - gq) is a series of bash scripts
which add a Mercurial queues-like [1] functionality and interface to git.
The one distinguishing feature from other quilt-like porcelains, is the
format of the patches directory. _All_ the information is stored as plain
text - a series file and the patches (one per file). This easily lends
itself to versioning the patches using any number of of SCMs.
The scripts have changed considerably since the initial announcement two
months ago. The current scripts are much more reliable, and follow more of
the quilt/mq semantics.
Tarballs:
http://www.kernel.org/pub/linux/kernel/people/jsipek/guilt/
Git repository:
git://git.kernel.org/pub/scm/linux/kernel/git/jsipek/guilt.git
The code is licensed under GPLv2.
Of course, contributions and feedback are welcomed :)
Josef "Jeff" Sipek.
[1] http://www.selenic.com/mercurial/wiki/index.cgi/MqExtension
[2] http://marc.theaimsgroup.com/?l=git&m=116349911807684&w=2
^ permalink raw reply
* Re: [PATCH] gitweb: Fix shortlog only showing HEAD revision.
From: Jakub Narebski @ 2007-01-03 20:36 UTC (permalink / raw)
To: git; +Cc: linux-kernel
In-Reply-To: <20070103202555.GA25768@localhost>
Robert Fitzsimons wrote:
> My change in 190d7fdcf325bb444fa806f09ebbb403a4ae4ee6 had a small bug
> found by Michael Krufky which caused the passed in hash value to be
> ignored, so shortlog would only show the HEAD revision.
>
> Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
Identical change, better commit message (I think).
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* [PATCH] gitweb: Make shortlog use 'h' (head) parameter again
From: Jakub Narebski @ 2007-01-03 20:30 UTC (permalink / raw)
To: git; +Cc: Michael Krufky, linux-kernel, Jakub Narebski
In-Reply-To: <459C0232.3090804@linuxtv.org>
This fixes typo in 190d7fdcf325bb444fa806f09ebbb403a4ae4ee6
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Michael Krufky wrote:
> Ever since gitweb on kernel.org was recently updated, I've been experiencing a
> nasty bug -- It seems that it is no longer possible to view a shortlog from any
> branch or head other than master.
[...]
> "log" and "tree" is working properly -- it seems that "shortlog" is the only
> feature affected by this bug.
This corrects this bug. When introducing parse_commits to shortlog,
there was typo in parse_commits arguments: it was $head instead of $hash.
gitweb/gitweb.perl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 2ead917..2179054 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4423,7 +4423,7 @@ sub git_shortlog {
}
my $refs = git_get_references();
- my @commitlist = parse_commits($head, 101, (100 * $page));
+ my @commitlist = parse_commits($hash, 101, (100 * $page));
my $paging_nav = format_paging_nav('shortlog', $hash, $head, $page, (100 * ($page+1)));
my $next_link = '';
--
1.4.4.3
^ permalink raw reply related
* [PATCH] gitweb: Fix shortlog only showing HEAD revision.
From: Robert Fitzsimons @ 2007-01-03 20:25 UTC (permalink / raw)
To: Michael Krufky, J.H.; +Cc: git, linux-kernel, Michael Krufky
In-Reply-To: <459C0232.3090804@linuxtv.org>
My change in 190d7fdcf325bb444fa806f09ebbb403a4ae4ee6 had a small bug
found by Michael Krufky which caused the passed in hash value to be
ignored, so shortlog would only show the HEAD revision.
Signed-off-by: Robert Fitzsimons <robfitz@273k.net>
---
Thanks for finding this Michael. It' just a small bug introducted by a
recent change I made. Including John 'Warthog9' so hopefully he can add
this to the version of gitweb which is hosted on kernel.org.
Robert
gitweb/gitweb.perl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index d845e91..2e94c2c 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4423,7 +4423,7 @@ sub git_shortlog {
}
my $refs = git_get_references();
- my @commitlist = parse_commits($head, 101, (100 * $page));
+ my @commitlist = parse_commits($hash, 101, (100 * $page));
my $paging_nav = format_paging_nav('shortlog', $hash, $head, $page, (100 * ($page+1)));
my $next_link = '';
--
t1.gaaaa
^ permalink raw reply related
* [PATCH 2/2] git-branch: show detached HEAD
From: Lars Hjemli @ 2007-01-03 20:10 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
In-Reply-To: <ec7218855930593c29c5ced76630ff7844947e6b.1167849110.git.hjemli@gmail.com>
This makes git-branch show a detached HEAD as '* (no branch)'.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
---
builtin-branch.c | 23 +++++++++++++++++------
1 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/builtin-branch.c b/builtin-branch.c
index b9a8bae..f04718d 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -275,7 +275,7 @@ static void print_ref_item(struct ref_item *item, int maxwidth, int verbose,
}
}
-static void print_ref_list(int kinds, int verbose, int abbrev)
+static void print_ref_list(int kinds, int detached, int verbose, int abbrev)
{
int i;
struct ref_list ref_list;
@@ -286,8 +286,20 @@ static void print_ref_list(int kinds, int verbose, int abbrev)
qsort(ref_list.list, ref_list.index, sizeof(struct ref_item), ref_cmp);
+ detached = (detached && (kinds & REF_LOCAL_BRANCH));
+ if (detached) {
+ struct ref_item item;
+ item.name = "(no branch)";
+ item.kind = REF_LOCAL_BRANCH;
+ hashcpy(item.sha1, head_sha1);
+ if (strlen(item.name) > ref_list.maxwidth)
+ ref_list.maxwidth = strlen(item.name);
+ print_ref_item(&item, ref_list.maxwidth, verbose, abbrev, 1);
+ }
+
for (i = 0; i < ref_list.index; i++) {
- int current = (ref_list.list[i].kind == REF_LOCAL_BRANCH) &&
+ int current = !detached &&
+ (ref_list.list[i].kind == REF_LOCAL_BRANCH) &&
!strcmp(ref_list.list[i].name, head);
print_ref_item(&ref_list.list[i], ref_list.maxwidth, verbose,
abbrev, current);
@@ -377,7 +389,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
{
int delete = 0, force_delete = 0, force_create = 0;
int rename = 0, force_rename = 0;
- int verbose = 0, abbrev = DEFAULT_ABBREV;
+ int verbose = 0, abbrev = DEFAULT_ABBREV, detached = 0;
int reflog = 0;
int kinds = REF_LOCAL_BRANCH;
int i;
@@ -455,8 +467,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
if (!head)
die("Failed to resolve HEAD as a valid ref.");
if (!strcmp(head, "HEAD")) {
- /* detached HEAD */
- ;
+ detached = 1;
}
else {
if (strncmp(head, "refs/heads/", 11))
@@ -467,7 +478,7 @@ int cmd_branch(int argc, const char **argv, const char *prefix)
if (delete)
return delete_branches(argc - i, argv + i, force_delete, kinds);
else if (i == argc)
- print_ref_list(kinds, verbose, abbrev);
+ print_ref_list(kinds, detached, verbose, abbrev);
else if (rename && (i == argc - 1))
rename_branch(head, argv[i], force_rename);
else if (rename && (i == argc - 2))
--
1.5.0.rc0.ge900
^ permalink raw reply related
* [PATCH 1/2] Refactor print-functions in builtin-branch
From: Lars Hjemli @ 2007-01-03 20:10 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
In-Reply-To: <11678550103703-git-send-email-hjemli@gmail.com>
This moves the guts of print_ref_list() into a revamped print_ref_info(),
which at the same time gets renamed to print_ref_item().
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
---
builtin-branch.c | 83 ++++++++++++++++++++++++++----------------------------
1 files changed, 40 insertions(+), 43 deletions(-)
diff --git a/builtin-branch.c b/builtin-branch.c
index 71f88f2..b9a8bae 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -231,29 +231,54 @@ static int ref_cmp(const void *r1, const void *r2)
return strcmp(c1->name, c2->name);
}
-static void print_ref_info(const unsigned char *sha1, int abbrev)
+static void print_ref_item(struct ref_item *item, int maxwidth, int verbose,
+ int abbrev, int current)
{
+ char c;
+ int color;
struct commit *commit;
char subject[256];
+ switch (item->kind) {
+ case REF_LOCAL_BRANCH:
+ color = COLOR_BRANCH_LOCAL;
+ break;
+ case REF_REMOTE_BRANCH:
+ color = COLOR_BRANCH_REMOTE;
+ break;
+ default:
+ color = COLOR_BRANCH_PLAIN;
+ break;
+ }
- commit = lookup_commit(sha1);
- if (commit && !parse_commit(commit))
- pretty_print_commit(CMIT_FMT_ONELINE, commit, ~0,
- subject, sizeof(subject), 0,
- NULL, NULL, 0);
- else
- strcpy(subject, " **** invalid ref ****");
+ c = ' ';
+ if (current) {
+ c = '*';
+ color = COLOR_BRANCH_CURRENT;
+ }
- printf(" %s %s\n", find_unique_abbrev(sha1, abbrev), subject);
+ if (verbose) {
+ commit = lookup_commit(item->sha1);
+ if (commit && !parse_commit(commit))
+ pretty_print_commit(CMIT_FMT_ONELINE, commit, ~0,
+ subject, sizeof(subject), 0,
+ NULL, NULL, 0);
+ else
+ strcpy(subject, " **** invalid ref ****");
+ printf("%c %s%-*s%s %s %s\n", c, branch_get_color(color),
+ maxwidth, item->name,
+ branch_get_color(COLOR_BRANCH_RESET),
+ find_unique_abbrev(item->sha1, abbrev), subject);
+ } else {
+ printf("%c %s%s%s\n", c, branch_get_color(color), item->name,
+ branch_get_color(COLOR_BRANCH_RESET));
+ }
}
static void print_ref_list(int kinds, int verbose, int abbrev)
{
int i;
- char c;
struct ref_list ref_list;
- int color;
memset(&ref_list, 0, sizeof(ref_list));
ref_list.kinds = kinds;
@@ -262,38 +287,10 @@ static void print_ref_list(int kinds, int verbose, int abbrev)
qsort(ref_list.list, ref_list.index, sizeof(struct ref_item), ref_cmp);
for (i = 0; i < ref_list.index; i++) {
- switch( ref_list.list[i].kind ) {
- case REF_LOCAL_BRANCH:
- color = COLOR_BRANCH_LOCAL;
- break;
- case REF_REMOTE_BRANCH:
- color = COLOR_BRANCH_REMOTE;
- break;
- default:
- color = COLOR_BRANCH_PLAIN;
- break;
- }
-
- c = ' ';
- if (ref_list.list[i].kind == REF_LOCAL_BRANCH &&
- !strcmp(ref_list.list[i].name, head)) {
- c = '*';
- color = COLOR_BRANCH_CURRENT;
- }
-
- if (verbose) {
- printf("%c %s%-*s%s", c,
- branch_get_color(color),
- ref_list.maxwidth,
- ref_list.list[i].name,
- branch_get_color(COLOR_BRANCH_RESET));
- print_ref_info(ref_list.list[i].sha1, abbrev);
- }
- else
- printf("%c %s%s%s\n", c,
- branch_get_color(color),
- ref_list.list[i].name,
- branch_get_color(COLOR_BRANCH_RESET));
+ int current = (ref_list.list[i].kind == REF_LOCAL_BRANCH) &&
+ !strcmp(ref_list.list[i].name, head);
+ print_ref_item(&ref_list.list[i], ref_list.maxwidth, verbose,
+ abbrev, current);
}
free_ref_list(&ref_list);
--
1.5.0.rc0.ge900
^ permalink raw reply related
* [PATCH 0/2] Enable git-branch to show detached HEAD
From: Lars Hjemli @ 2007-01-03 20:10 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
These two patches let git-branch show a detached HEAD in a sensible way:
[PATCH 1/2] Refactor print-functions in builtin-branch
[PATCH 2/2] git-branch: show detached HEAD
^ permalink raw reply
* GITWEB branch shortlog broken after recent update on kernel.org
From: Michael Krufky @ 2007-01-03 19:21 UTC (permalink / raw)
To: git; +Cc: linux-kernel, Michael Krufky
Ever since gitweb on kernel.org was recently updated, I've been experiencing a
nasty bug -- It seems that it is no longer possible to view a shortlog from any
branch or head other than master.
For example:
http://www2.kernel.org/git/?p=linux/kernel/git/mkrufky/v4l-dvb-2.6.x.y.git
^^ this is a link to my v4l-dvb-2.6.x.y stable repository. I have branched off
each kernel release to include all of the -stable release history. You will
notice these in the 'heads' section near the bottom of the page.
If you click on the 2.6.16.y shortlog link:
http://www2.kernel.org/git/?p=linux/kernel/git/mkrufky/v4l-dvb-2.6.x.y.git;a=shortlog;h=2.6.16.y
gitweb displays the shortlog from the master branch, instead of the 2.6.16.y head.
However, if you click the "log" link:
http://www2.kernel.org/git/?p=linux/kernel/git/mkrufky/v4l-dvb-2.6.x.y.git;a=log;h=2.6.16.y
Only then, does gitweb show us the correct history for that branch.
"tree" is also working properly -- it seems that "shortlog" is the only feature
affected by this bug.
In the previous vesion of gitweb installed on kernel.org, this feature did
indeed function properly.
Can this be fixed? I often use gitweb to view changesets in developer trees
before those changesets get pulled into the master branch of a repository. I
find this feature very helpful for reviewing changesets, and I'd like for it to
work again.
Thanks in advance,
Michael Krufky
^ permalink raw reply
* [PATCH 2/2] gitweb: There can be empty patches (in git_patchset_body)
From: Jakub Narebski @ 2007-01-03 19:47 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski
In-Reply-To: <11678536452473-git-send-email-jnareb@gmail.com>
We now do not skip over empty patches in git_patchset_body
(where empty means that they consist only of git diff header,
and of extended diff header), so uncomment branch of code dealing
with empty patches (patches which do not have even two-line
from/to header)
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
gitweb/gitweb.perl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 05b3876..2ead917 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2527,7 +2527,7 @@ sub git_patchset_body {
print "<div class=\"diff from_file\">$patch_line</div>\n";
$patch_line = <$fd>;
- #last PATCH unless $patch_line;
+ last PATCH unless $patch_line;
chomp $patch_line;
#assert($patch_line =~ m/^+++/) if DEBUG;
--
1.4.4.3
^ permalink raw reply related
* [PATCH 1/2] gitweb: Fix bug in git_difftree_body (was '!=' instead of 'ne')
From: Jakub Narebski @ 2007-01-03 19:47 UTC (permalink / raw)
To: git; +Cc: Jakub Narebski
Fix bug in git_difftree_body subroutine; it was used '!=' comparison
operator for strings (file type) instead of correct 'ne'.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
gitweb/gitweb.perl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 7f54834..05b3876 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2274,7 +2274,7 @@ sub git_difftree_body {
my $mode_chnge = "";
if ($diff{'from_mode'} != $diff{'to_mode'}) {
$mode_chnge = "<span class=\"file_status mode_chnge\">[changed";
- if ($from_file_type != $to_file_type) {
+ if ($from_file_type ne $to_file_type) {
$mode_chnge .= " from $from_file_type to $to_file_type";
}
if (($from_mode_oct & 0777) != ($to_mode_oct & 0777)) {
--
1.4.4.3
^ permalink raw reply related
* Re: [PATCH] Documentation/tutorial: misc updates
From: Santi Béjar @ 2007-01-03 17:31 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Horst H. von Brand
In-Reply-To: <7vejqcoz7s.fsf@assigned-by-dhcp.cox.net>
On 1/3/07, Junio C Hamano <junkio@cox.net> wrote:
> "Santi Béjar" <sbejar@gmail.com> writes:
>
> > On 1/3/07, Horst H. von Brand <vonbrand@inf.utfsm.cl> wrote:
> >> Santi Béjar <sbejar@gmail.com> wrote:
> >> >
> >> > -Every commit has at least one "parent" commit, which points to the
> >> > -previous state of the project:
> >> > +Every commit has at least one "parent" commit (except the first),
> >> > +which points to the previous state of the project:
> >>
> >> And how can it have more than one parent? If you mention it, better come
> >> clean about merges (can be explained in detail later).
> >
> > I have not mentined it, I've just added the exception that the
> > firt/root commits have zero parents.
>
> Well, it does not matter who originally is at fault ;-).
Sure, we all try to make git better and better.
>
> Let's just do this.
>
> diff --git a/Documentation/tutorial.txt b/Documentation/tutorial.txt
> index f0a5526..0cc234f 100644
> --- a/Documentation/tutorial.txt
> +++ b/Documentation/tutorial.txt
> @@ -400,7 +400,7 @@ $ git show HEAD # the tip of the current branch
> $ git show experimental # the tip of the "experimental" branch
> -------------------------------------
>
> -Every commit has at least one "parent" commit (except the first),
> +Every commit usually has one "parent" commit
> which points to the previous state of the project:
>
> -------------------------------------
>
> After this paragraph, we say "merge has more than one", so it's
> all consistent and presented in the right order. By the time
> the reader starts wondering about the initial commit, we've
> shown the use of HEAD^^^^ and HEAD~$n enough that the reader can
> experiment on his/her own.
OK here.
Santi
^ permalink raw reply
* Re: [DRAFT] Branching and merging with git
From: Junio C Hamano @ 2007-01-03 17:08 UTC (permalink / raw)
To: linux; +Cc: git, Theodore Tso
In-Reply-To: <20070103170411.GB5491@thunk.org>
Theodore Tso <tytso@mit.edu> writes:
> On Thu, Nov 16, 2006 at 05:17:01PM -0500, linux@horizon.com wrote:
>> I know it took me a while to get used to playing with branches, and I
>> still get nervous when doing something creative. So I've been trying
>> to get more comfortable, and wrote the following to document what I've
>> learned.
>
> What ever happened to this document? There was some talk of getting
> this integrated into the git tree as Docmentation/tutorial-3.txt.
> IMHO it would be really, really good to do this before 1.5.0, since I
> think a lot of users would find it really useful.
Seconded. Can I have the latest round?
^ permalink raw reply
* Re: [DRAFT] Branching and merging with git
From: Theodore Tso @ 2007-01-03 17:04 UTC (permalink / raw)
To: linux; +Cc: git
In-Reply-To: <20061116221701.4499.qmail@science.horizon.com>
On Thu, Nov 16, 2006 at 05:17:01PM -0500, linux@horizon.com wrote:
> I know it took me a while to get used to playing with branches, and I
> still get nervous when doing something creative. So I've been trying
> to get more comfortable, and wrote the following to document what I've
> learned.
What ever happened to this document? There was some talk of getting
this integrated into the git tree as Docmentation/tutorial-3.txt.
IMHO it would be really, really good to do this before 1.5.0, since I
think a lot of users would find it really useful. Some of the text
may need to be moved to other locations, but it might go faster if we
get the base document into the tree first, and then we can submit
patches to move text around to integrate it into the other
documentation files.
I'm certainly willing to help out submitting patches to improve the
documentation, and I think this would be a big step towards helping
new users to git become much more quickly proficient.
- Ted
^ permalink raw reply
* Re: [PATCH] Skip excessive blank lines before commit body
From: Junio C Hamano @ 2007-01-03 17:03 UTC (permalink / raw)
To: Lars Hjemli; +Cc: git, Marco Costalba
In-Reply-To: <11678312532251-git-send-email-hjemli@gmail.com>
Lars Hjemli <hjemli@gmail.com> writes:
> This modifies pretty_print_commit() to make the output of
> git-rev-list and friends a bit more predictable.
>
> A commit body starting with blank lines might be unheard-of,
> but still possible to create using git-commit-tree (so is
> bound to appear somewhere, sometime).
This is unfortunately (!!) a good change. By design,
commit-tree should take whatever binary garbage the user throws
at it as-is (there is no requirement for it to be even text),
and the "punchline + LF + body + LF + signoffs" is strictly by
convention. We already reformat using indentations and friends,
so your change is a very sane thing to do.
We might want to tighten the formatting convention enforced at
the Porcelain level -- we can start the process by shipping a
sample commit message hook that checks a well formatted commit
log message, perhaps?
^ permalink raw reply
* Re: [PATCH] git-tag: add flag to verify a tag
From: Santi Béjar @ 2007-01-03 16:36 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vac10oz54.fsf@assigned-by-dhcp.cox.net>
On 1/3/07, Junio C Hamano <junkio@cox.net> wrote:
> Santi Béjar <sbejar@gmail.com> writes:
>
> > This way "git tag -v $tag" is the UI for git-verify-tag.
> > ---
> > Documentation/git-tag.txt | 7 ++++++-
> > ...
>
>
> Signoffs?
Forgotten, long time since the last patch :-|
Signed-off-by: Santi Béjar <sbejar@gmail.com>
Santi
^ permalink raw reply
* Re: [PATCH] git-tag: add flag to verify a tag
From: Junio C Hamano @ 2007-01-03 16:25 UTC (permalink / raw)
To: Santi Béjar; +Cc: git
In-Reply-To: <877iw4tgff.fsf@gmail.com>
Santi Béjar <sbejar@gmail.com> writes:
> This way "git tag -v $tag" is the UI for git-verify-tag.
> ---
> Documentation/git-tag.txt | 7 ++++++-
> ...
Signoffs?
^ permalink raw reply
* Re: [PATCH] Documentation/tutorial: misc updates
From: Junio C Hamano @ 2007-01-03 16:24 UTC (permalink / raw)
To: Santi Béjar; +Cc: git, Horst H. von Brand
In-Reply-To: <8aa486160701030609g22eadf0brf8743dad5701f315@mail.gmail.com>
"Santi Béjar" <sbejar@gmail.com> writes:
> On 1/3/07, Horst H. von Brand <vonbrand@inf.utfsm.cl> wrote:
>> Santi Béjar <sbejar@gmail.com> wrote:
>> >
>> > -Every commit has at least one "parent" commit, which points to the
>> > -previous state of the project:
>> > +Every commit has at least one "parent" commit (except the first),
>> > +which points to the previous state of the project:
>>
>> And how can it have more than one parent? If you mention it, better come
>> clean about merges (can be explained in detail later).
>
> I have not mentined it, I've just added the exception that the
> firt/root commits have zero parents.
Well, it does not matter who originally is at fault ;-).
Let's just do this.
diff --git a/Documentation/tutorial.txt b/Documentation/tutorial.txt
index f0a5526..0cc234f 100644
--- a/Documentation/tutorial.txt
+++ b/Documentation/tutorial.txt
@@ -400,7 +400,7 @@ $ git show HEAD # the tip of the current branch
$ git show experimental # the tip of the "experimental" branch
-------------------------------------
-Every commit has at least one "parent" commit (except the first),
+Every commit usually has one "parent" commit
which points to the previous state of the project:
-------------------------------------
After this paragraph, we say "merge has more than one", so it's
all consistent and presented in the right order. By the time
the reader starts wondering about the initial commit, we've
shown the use of HEAD^^^^ and HEAD~$n enough that the reader can
experiment on his/her own.
^ permalink raw reply related
* Re: [PATCH/RFC] tutorial.txt: update to use the "git clone --add"
From: Brian Gernhardt @ 2007-01-03 15:40 UTC (permalink / raw)
To: Santi Béjar; +Cc: Git Mailing List
In-Reply-To: <87bqlgtghx.fsf@gmail.com>
On Jan 3, 2007, at 7:57 AM, Santi Béjar wrote:
> This is a RFC because there is not such "git clone --add".
>
> I think it make sense to have it and to use it in the tutorial. This
> way all the branches are in the separate-layout, so newbies only have
> to understand one layout.
>
> Comments?
I like the idea, but lack the tuits to try to create it.
~~ Brian
^ permalink raw reply
* [PATCH] Add documentation for git-branch's color configuration.
From: Brian Gernhardt @ 2007-01-03 15:36 UTC (permalink / raw)
To: git
Added color.branch and color.branch.<slot> to configuration list.
Style copied from color.status and meanings derived from the code.
Moved the color meanings from color.diff.<slot> to color.branch.<slot>
since the latter comes first alphabetically.
Added --color and --no-color to git-branch's usage and documentation.
Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
---
When looking through the code, I noticed that git-branch had color
options. Who knew? Not me.
I checked, but couldn't find, any other color options to document.
Documentation/config.txt | 24 ++++++++++++++++++------
Documentation/git-branch.txt | 9 ++++++++-
builtin-branch.c | 2 +-
3 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 2f4fc25..4318bf9 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -145,6 +145,21 @@ branch.<name>.merge::
this option, `git pull` defaults to merge the first refspec fetched.
Specify multiple values to get an octopus merge.
+color.branch::
+ A boolean to enable/disable color in the output of
+ gitlink:git-branch[1]. May be set to `true` (or `always`),
+ `false` (or `never`) or `auto`, in which case colors are used
+ only when the output is to a terminal. Defaults to false.
+
+color.branch.<slot>::
+ Use customized color for branch coloration. `<slot>` is one of
+ `current` (the current branch), `local` (a local branch),
+ `remote` (a tracking branch in refs/remotes/), `plain` (other
+ refs), or `reset` (the normal terminal color). The value for
+ these configuration variables can be one of: `normal`, `bold`,
+ `dim`, `ul`, `blink`, `reverse`, `reset`, `black`, `red`,
+ `green`, `yellow`, `blue`, `magenta`, `cyan`, or `white`.
+
color.diff::
When true (or `always`), always use colors in patch.
When false (or `never`), never. When set to `auto`, use
@@ -155,11 +170,8 @@ color.diff.<slot>::
specifies which part of the patch to use the specified
color, and is one of `plain` (context text), `meta`
(metainformation), `frag` (hunk header), `old` (removed
- lines), or `new` (added lines). The value for these
- configuration variables can be one of: `normal`, `bold`,
- `dim`, `ul`, `blink`, `reverse`, `reset`, `black`,
- `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, or
- `white`.
+ lines), or `new` (added lines). The values of these
+ variables may be specified as in color.branch.<slot>.
color.pager::
A boolean to enable/disable colored output when the pager is in
@@ -177,7 +189,7 @@ color.status.<slot>::
`added` or `updated` (files which are added but not committed),
`changed` (files which are changed but not added in the index),
or `untracked` (files which are not tracked by git). The values of
- these variables may be specified as in color.diff.<slot>.
+ these variables may be specified as in color.branch.<slot>.
diff.renameLimit::
The number of files to consider when performing the copy/rename
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index c464bd2..e872fc8 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -8,7 +8,7 @@ git-branch - List, create, or delete branches.
SYNOPSIS
--------
[verse]
-'git-branch' [-r | -a] [-v [--abbrev=<length>]]
+'git-branch' [--color | --no-color] [-r | -a] [-v [--abbrev=<length>]]
'git-branch' [-l] [-f] <branchname> [<start-point>]
'git-branch' (-m | -M) [<oldbranch>] <newbranch>
'git-branch' (-d | -D) [-r] <branchname>...
@@ -60,6 +60,13 @@ OPTIONS
-M::
Move/rename a branch even if the new branchname already exists.
+--color::
+ Color branches to highlight current, local, and remote branches.
+
+--no-color::
+ Turn off branch colors, even when the configuration file gives the
+ default to color output.
+
-r::
List or delete (if used with -d) the remote-tracking branches.
diff --git a/builtin-branch.c b/builtin-branch.c
index 745ee04..1ed0fa9 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -12,7 +12,7 @@
#include "builtin.h"
static const char builtin_branch_usage[] =
- "git-branch [-r] (-d | -D) <branchname> | [-l] [-f] <branchname> [<start-point>] | (-m | -M) [<oldbranch>] <newbranch> | [-r | -a] [-v [--abbrev=<length>]]";
+ "git-branch [-r] (-d | -D) <branchname> | [-l] [-f] <branchname> [<start-point>] | (-m | -M) [<oldbranch>] <newbranch> | [--color | --no-color] [-r | -a] [-v [--abbrev=<length>]]";
#define REF_UNKNOWN_TYPE 0x00
#define REF_LOCAL_BRANCH 0x01
--
1.5.0.rc0.g825ce
^ permalink raw reply related
* Re: [BUG] daemon.c blows up on OSX
From: Andreas Ericsson @ 2007-01-03 15:25 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Terje Sten Bjerkseth, Linus Torvalds, git
In-Reply-To: <7vtzzq3wo6.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
>
> Does everybody use Apple CC on OSX? Is the symbol defined even
> with GCC? Or Gcc fixes headers well enough and makes this a
> non-issue?
>
Just for future reference
http://predef.sourceforge.net/preos.html
holds a pretty complete list of identifying macros for more kinds of
systems than I've had the questionable privilege of having to work with.
I've used it pretty extensively when trying to write portable code,
since I too have a hard time liking autoconf and friends.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
^ 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