* [RFC PATCH 1/6] gitweb: Hyperlink committags in a commit message by regex matching
From: Marcel M. Cary @ 2009-11-18 6:22 UTC (permalink / raw)
To: Jakub Narebski, git
Cc: Petr Baudis, Giuseppe Bilotta, Francis Galiegue, Marcel M. Cary
In-Reply-To: <1258525350-5528-1-git-send-email-marcel@oak.homeunix.org>
I want gitweb to hyperlink commits to my bug tracking system so that
information regarding the current status of a commit can be easily
cross-referenced. The QA and release status of a commit cannot be
directly inserted into the commit message because they change over
time. But if the commit message mentions a bug number, gitweb could
detect the bug reference in the message and hyperlink it to the bug
tracking system. Other repository browsers such as unfuddle and
websvn support similar features.
Currently only commit hashes are hyperlinked in this manner.
Since the bug hyperlinking feature was previously discussed as part of
"committags," a more general mechanism to embellish commit messages,
implement the more general mechanism instead, including the following
capabilities:
* Hyperlinking mentions of bug IDs to Bugzilla
* Hyperlinking URLs
* Hyperlinking Message-Ids to a mailing list archive
* Hyperlinking commit hashes, as before by default, now with a
configurable regex
* Defining new committags per gitweb installation
Since different repositories may use different bug tracking systems or
mailing list archives, the URL parameter may be configured
per-repository without reiterating the regexes. To accomodate
different conventions, regexes may also be configured per-project.
The order in which gitweb applies committags may be configured
per-project as well, because one committag may affect subsequent ones.
Inclusion in this sequence determines whether a committag is enabled
or not.
Signed-off-by: Marcel M. Cary <marcel@oak.homeunix.org>
---
One additional thing that occured to me is that maybe the hyperlinks
added by committags should have 'rel="nofollow"' by default? And if
so, maybe that needs to be configurable? On the other hand, I'm not
sure how useful it is to hide real URLs in the commit messages from
search engines... ?
gitweb/INSTALL | 5 +
gitweb/gitweb.perl | 247 +++++++++++++++++++++++++++++++++++++++---
t/t9502-gitweb-committags.sh | 150 +++++++++++++++++++++++++
3 files changed, 389 insertions(+), 13 deletions(-)
create mode 100755 t/t9502-gitweb-committags.sh
diff --git a/gitweb/INSTALL b/gitweb/INSTALL
index b76a0cf..9081ed8 100644
--- a/gitweb/INSTALL
+++ b/gitweb/INSTALL
@@ -132,6 +132,11 @@ adding the following lines to your $GITWEB_CONFIG:
$known_snapshot_formats{'zip'}{'disabled'} = 1;
$known_snapshot_formats{'tgz'}{'compressor'} = ['gzip','-6'];
+To add a committag to the default list of commit tags, for example to
+enable hyperlinking of bug numbers to a bug tracker for all projects:
+
+ push @{$feature{'committags'}{'default'}}, 'bugzilla';
+
Gitweb repositories
-------------------
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index e4cbfc3..2d72202 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -213,6 +213,97 @@ our %avatar_size = (
'double' => 32
);
+# In general, the site admin can enable/disable per-project
+# configuration of each committag. Only the 'options' part of the
+# committag is configurable per-project.
+#
+# The site admin can of course add new tags to this hash or override
+# the 'sub' key if necessary. But such changes may be fragile; this
+# is not designed as a full-blown plugin architecture. The 'sub' must
+# return a list of strings or string refs. The strings must contain
+# plain text and the string refs must contain HTML. The string refs
+# will not be processed further.
+#
+# For any committag, set the 'override' key to 1 to allow individual
+# projects to override entries in the 'options' hash for that tag.
+# For example, to match only commit hashes given in lowercase in one
+# project, add this to the $GITWEB_CONFIG:
+#
+# $committags{'sha1'}{'override'} = 1;
+#
+# And in the project's config:
+#
+# gitweb.committags.sha1.pattern = \\b([0-9a-f]{8,40})\\b
+#
+# Some committags have additional options whose interpretation depends
+# on the implementation of the 'sub' key. The hyperlink_committag
+# value appends the first captured group to the 'url' option.
+our %committags = (
+ # Link Git-style hashes to this gitweb
+ 'sha1' => {
+ 'options' => {
+ 'pattern' => qr/\b([0-9a-fA-F]{8,40})\b/,
+ },
+ 'override' => 0,
+ 'sub' => sub {
+ my ($opts, @match) = @_;
+ return \$cgi->a({-href => href(action=>"object", hash=>$match[1]),
+ -class => "text"},
+ esc_html($match[0], -nbsp=>1));
+ },
+ },
+ # Link bug/features to Mantis bug tracker using Mantis-style
+ # contextual cues
+ 'mantis' => {
+ 'options' => {
+ 'pattern' => qr/(?:BUG|FEATURE)\((\d+)\)/,
+ 'url' => 'http://www.example.com/mantisbt/view.php?id=',
+ },
+ 'override' => 0,
+ 'sub' => \&hyperlink_committag,
+ },
+ # Link mentions of bug IDs to bugzilla
+ 'bugzilla' => {
+ 'options' => {
+ 'pattern' => qr/bug\s+(\d+)/,
+ 'url' => 'http://bugzilla.example.com/show_bug.cgi?id=',
+ },
+ 'override' => 0,
+ 'sub' => \&hyperlink_committag,
+ },
+ # Link URLs
+ 'url' => {
+ 'options' => {
+ # Avoid matching punctuation that might immediately follow
+ # a url, is not part of the url, and is allowed in urls,
+ # like a full-stop ('.').
+ 'pattern' => qr!(https?|ftps?|git|ssh|ssh+git|sftp|smb|webdavs?|
+ nfs|irc|nntp|rsync)
+ ://[-_a-zA-Z0-9\@/&=+~#<>;%:.?]+
+ [-_a-zA-Z0-9\@/&=+~#<>]!x,
+ },
+ 'override' => 0,
+ 'sub' => sub {
+ my ($opts, @match) = @_;
+ return \$cgi->a({-href => $match[0],
+ -class => "text"},
+ esc_html($match[0], -nbsp=>1));
+ },
+ },
+ # Link Message-Id to mailing list archive
+ 'messageid' => {
+ 'options' => {
+ 'pattern' => qr!(?:message|msg)-?id:?\s+(<[^>]+>)!i,
+ 'url' => 'http://mid.gmane.org/',
+ },
+ 'override' => 0,
+ # Includes the "msg-id" text in the link text.
+ # Since we don't support linking multiple msg-ids in one match, we
+ # can include the "msg-id" in the link text for better context.
+ 'sub' => \&hyperlink_committag,
+ },
+);
+
# You define site-wide feature defaults here; override them with
# $GITWEB_CONFIG as necessary.
our %feature = (
@@ -258,7 +349,7 @@ our %feature = (
# and in project config, a comma-separated list of formats or "none"
# to disable. Example: gitweb.snapshot = tbz2,zip;
'snapshot' => {
- 'sub' => \&feature_snapshot,
+ 'sub' => sub { feature_list('snapshot', @_) },
'override' => 0,
'default' => ['tgz']},
@@ -417,6 +508,21 @@ our %feature = (
'sub' => \&feature_avatar,
'override' => 0,
'default' => ['']},
+
+ # The selection and ordering of committags that are enabled.
+ # Committag transformations will be applied to commit log messages
+ # in the order listed here if listed here.
+
+ # To disable system wide have in $GITWEB_CONFIG
+ # $feature{'committags'}{'default'} = [];
+ # To have project specific config enable override in $GITWEB_CONFIG
+ # $feature{'committags'}{'override'} = 1;
+ # and in project config gitweb.committags = sha1, url, bugzilla
+ # to enable those three committags for that project
+ 'committags' => {
+ 'sub' => sub { feature_list('committags', @_) },
+ 'override' => 0,
+ 'default' => ['sha1']},
);
sub gitweb_get_feature {
@@ -463,16 +569,16 @@ sub feature_bool {
}
}
-sub feature_snapshot {
- my (@fmts) = @_;
+sub feature_list {
+ my ($key, @defaults) = @_;
- my ($val) = git_get_project_config('snapshot');
+ my ($cfg) = git_get_project_config($key);
- if ($val) {
- @fmts = ($val eq 'none' ? () : split /\s*[,\s]\s*/, $val);
+ if ($cfg) {
+ return ($cfg eq 'none' ? () : split(/\s*[,\s]\s*/, $cfg));
}
- return @fmts;
+ return @defaults;
}
sub feature_patches {
@@ -886,6 +992,35 @@ if ($git_avatar eq 'gravatar') {
$git_avatar = '';
}
+# ordering of committags
+our @committags = gitweb_get_feature('committags');
+
+# whether we've loaded committags for the project yet
+our $loaded_project_committags = 0;
+
+# Load committag configs from the repository config file and and
+# incorporate them into the gitweb defaults where permitted by the
+# site administrator.
+sub gitweb_load_project_committags {
+ return if (!$git_dir || $loaded_project_committags);
+ my %project_config = ();
+ my %raw_config = git_parse_project_config('gitweb\.committag');
+ foreach my $key (keys(%raw_config)) {
+ next if ($key !~ /gitweb\.committag\.[^.]+\.[^.]/);
+ my ($gitweb_prefix, $committag_prefix, $ctname, $option) =
+ split(/\./, $key, 4);
+ $project_config{$ctname}{$option} = $raw_config{$key};
+ }
+ foreach my $ctname (keys(%committags)) {
+ next if (!$committags{$ctname}{'override'});
+ foreach my $optname (keys %{$project_config{$ctname}}) {
+ $committags{$ctname}{'options'}{$optname} =
+ $project_config{$ctname}{$optname};
+ }
+ }
+ $loaded_project_committags = 1;
+}
+
# dispatch
if (!defined $action) {
if (defined $hash) {
@@ -1458,13 +1593,99 @@ sub file_type_long {
sub format_log_line_html {
my $line = shift;
- $line = esc_html($line, -nbsp=>1);
- $line =~ s{\b([0-9a-fA-F]{8,40})\b}{
- $cgi->a({-href => href(action=>"object", hash=>$1),
- -class => "text"}, $1);
- }eg;
+ # Merge project configs with site default committag definitions if
+ # it hasn't been done yet
+ gitweb_load_project_committags();
- return $line;
+ # In this list of log message fragments, a string ref indicates
+ # HTML, and a string indicates plain text. The string refs are
+ # also currently not processed by subsequent committags.
+ my @message_fragments = ( $line );
+
+COMMITTAG:
+ foreach my $ctname (@committags) {
+ next COMMITTAG unless exists $committags{$ctname};
+ my $committag = $committags{$ctname};
+
+ next COMMITTAG unless exists $committag->{'sub'};
+ my $sub = $committag->{'sub'};
+
+ next COMMITTAG unless exists $committag->{'options'};
+ my $opts = $committag->{'options'};
+
+ next COMMITTAG unless exists $opts->{'pattern'};
+ my $pattern = $opts->{'pattern'};
+
+ my @new_message_fragments = ();
+
+ PART:
+ foreach my $fragment (@message_fragments) {
+ next PART if $fragment eq "";
+ if (ref($fragment)) {
+ push @new_message_fragments, $fragment;
+ next PART;
+ }
+
+ my $oldpos = 0;
+
+ MATCH:
+ while ($fragment =~ m/$pattern/gc) {
+ my ($prepos, $postpos) = ($-[0], $+[0]);
+ my $repl = $sub->($opts, $&, $1);
+ $repl = "" if (!defined $repl);
+
+ my $pre = substr($fragment, $oldpos, $prepos - $oldpos);
+ push_or_append(\@new_message_fragments, $pre);
+ push_or_append(\@new_message_fragments, $repl);
+
+ $oldpos = $postpos;
+ } # end while [regexp matches]
+
+ my $rest = substr($fragment, $oldpos);
+ push_or_append(\@new_message_fragments, $rest);
+
+ } # end foreach (@message_fragments)
+
+ @message_fragments = @new_message_fragments;
+ } # end foreach (@committags)
+
+ # Escape any remaining plain text and concatenate
+ my $html = '';
+ for my $fragment (@message_fragments) {
+ if (ref($fragment)) {
+ $html .= $$fragment;
+ } else {
+ $html .= esc_html($fragment, -nbsp=>1);
+ }
+ }
+
+ return $html;
+}
+
+# Returns a ref to an HTML snippet that links the whole match to a URL
+# formed from the 'url' option and the first captured subgroup. This
+# is a helper function used in %committags.
+sub hyperlink_committag {
+ my ($opts, @match) = @_;
+ return \$cgi->a({-href => $opts->{'url'} . $cgi->escape($match[1]),
+ -class => "text"},
+ esc_html($match[0], -nbsp=>1));
+}
+
+
+sub push_or_append (\@@) {
+ my $fragments = shift;
+
+ if (ref $_[0] || ! @$fragments || ref $fragments->[-1]) {
+ push @$fragments, @_;
+ } else {
+ my $a = pop @$fragments;
+ my $b = shift @_;
+
+ push @$fragments, $a . $b, @_;
+ }
+ # imitate push
+ return scalar @$fragments;
}
# format marker of refs pointing to given object
diff --git a/t/t9502-gitweb-committags.sh b/t/t9502-gitweb-committags.sh
new file mode 100755
index 0000000..f86cb3d
--- /dev/null
+++ b/t/t9502-gitweb-committags.sh
@@ -0,0 +1,150 @@
+#!/bin/sh
+
+test_description='gitweb committag tests.
+
+This test runs gitweb (git web interface) as CGI script from
+commandline, and checks that committags perform the expected
+transformations on log messages.'
+
+. ./gitweb-lib.sh
+
+# ----------------------------------------------------------------------
+# sha1 linking
+#
+echo sha1_test > file.txt
+git add file.txt
+git commit -q -F - file.txt <<END
+Summary
+
+See also commit 567890ab
+END
+test_expect_success 'sha1 link: enabled by default' '
+ gitweb_run "p=.git;a=commit;h=HEAD" &&
+ grep -q \
+ "commit <a class=\"text\" href=\".*\">567890ab</a>" \
+ gitweb.output
+'
+test_debug 'cat gitweb.log'
+test_debug 'grep 567890ab gitweb.output'
+
+# ----------------------------------------------------------------------
+# bugzilla commit tag
+#
+
+echo bugzilla_test > file.txt
+git add file.txt
+git commit -q -F - file.txt <<END
+Fix foo
+
+Fixes bug 1234 involving foo.
+END
+git config gitweb.committags 'sha1, bugzilla'
+test_expect_success 'bugzilla: enabled but not permitted' '
+ gitweb_run "p=.git;a=commit;h=HEAD" &&
+ grep -F -q \
+ "Fixes bug 1234 involving" \
+ gitweb.output
+'
+test_debug 'cat gitweb.log'
+test_debug 'grep 1234 gitweb.output'
+
+echo '$feature{"committags"}{"override"} = 1;' >> gitweb_config.perl
+test_expect_success 'bugzilla: enabled' '
+ gitweb_run "p=.git;a=commit;h=HEAD" &&
+ grep -F -q \
+ "Fixes <a class=\"text\" href=\"http://bugzilla.example.com/show_bug.cgi?id=1234\">bug 1234</a> involving" \
+ gitweb.output
+'
+test_debug 'cat gitweb.log'
+test_debug 'grep 1234 gitweb.output'
+
+git config gitweb.committag.bugzilla.url 'http://bts.example.com?bug='
+test_expect_success 'bugzilla: url overridden but not permitted' '
+ gitweb_run "p=.git;a=commit;h=HEAD" &&
+ grep -F -q \
+ "Fixes <a class=\"text\" href=\"http://bugzilla.example.com/show_bug.cgi?id=1234\">bug 1234</a> involving" \
+ gitweb.output
+'
+test_debug 'cat gitweb.log'
+test_debug 'grep 1234 gitweb.output'
+
+echo '$committags{"bugzilla"}{"override"} = 1;' >> gitweb_config.perl
+test_expect_success 'bugzilla: url overridden' '
+ gitweb_run "p=.git;a=commit;h=HEAD" &&
+ grep -F -q \
+ "Fixes <a class=\"text\" href=\"http://bts.example.com?bug=1234\">bug 1234</a> involving" \
+ gitweb.output
+'
+test_debug 'cat gitweb.log'
+test_debug 'grep 1234 gitweb.output'
+
+git config gitweb.committag.bugzilla.pattern 'Fixes bug (\d+)'
+test_expect_success 'bugzilla: pattern overridden' '
+ gitweb_run "p=.git;a=commit;h=HEAD" &&
+ grep -F -q \
+ "<a class=\"text\" href=\"http://bts.example.com?bug=1234\">Fixes bug 1234</a> involving" \
+ gitweb.output
+'
+test_debug 'cat gitweb.log'
+test_debug 'grep 1234 gitweb.output'
+git config --unset gitweb.committag.bugzilla.pattern
+
+test_expect_success 'bugzilla: affects log view too' '
+ gitweb_run "p=.git;a=log" &&
+ grep -F -q \
+ "<a class=\"text\" href=\"http://bts.example.com?bug=1234\">bug 1234</a>" \
+ gitweb.output
+'
+test_debug 'cat gitweb.log'
+test_debug 'grep 1234 gitweb.output'
+
+# ----------------------------------------------------------------------
+# url linking
+#
+echo url_test > file.txt
+git add file.txt
+url='http://user@pass:example.com/foo.html?u=v&x=y#z'
+url_esc="$(echo "$url" | sed 's/&/&/g')"
+git commit -q -F - file.txt <<END
+Summary
+
+See also $url.
+END
+echo '$feature{"committags"}{"override"} = 1;' >> gitweb_config.perl
+git config gitweb.committags 'sha1, url'
+test_expect_success 'url link: links when enabled' '
+ gitweb_run "p=.git;a=commit;h=HEAD" &&
+ grep -q -F \
+ "See also <a class=\"text\" href=\"$url_esc\">$url_esc</a>." \
+ gitweb.output
+'
+test_debug 'cat gitweb.log'
+test_debug 'grep -F "$url" gitweb.output'
+
+# ----------------------------------------------------------------------
+# message id linking
+#
+echo msgid_test > file.txt
+git add file.txt
+url='http://mid.gmane.org/'
+msgid='<x@y.z>'
+msgid_esc="$(echo "$msgid" | sed 's/</\</g; s/>/\>/g')"
+msgid_url="$url$(echo "$msgid" | sed 's/</%3C/g; s/@/%40/g; s/>/%3E/g')"
+git commit -q -F - file.txt <<END
+Summary
+
+See msg-id $msgid.
+END
+echo '$feature{"committags"}{"override"} = 1;' >> gitweb_config.perl
+git config gitweb.committags 'sha1, messageid'
+test_expect_success 'msgid link: linked when enabled' '
+ gitweb_run "p=.git;a=commit;h=HEAD" &&
+ grep -q -F \
+ "See <a class=\"text\" href=\"$msgid_url\">msg-id $msgid_esc</a>." \
+ gitweb.output
+'
+test_debug 'cat gitweb.log'
+test_debug 'grep -F "y.z" gitweb.output'
+
+
+test_done
--
1.6.4.4
^ permalink raw reply related
* Re: [PATCH 1/2] replace: use a GIT_NO_REPLACE_OBJECTS env variable
From: Christian Couder @ 2009-11-18 6:48 UTC (permalink / raw)
To: Johannes Sixt
Cc: Junio C Hamano, git, Michael J Gruber, Jakub Narebski, bill lam,
Andreas Schwab, Paul Mackerras
In-Reply-To: <4B0253DA.1090003@viscovery.net>
On mardi 17 novembre 2009, Johannes Sixt wrote:
> Christian Couder schrieb:
> > diff --git a/git.c b/git.c
> > index bd2c5fe..7f7d73d 100644
> > --- a/git.c
> > +++ b/git.c
> > @@ -89,6 +89,9 @@ static int handle_options(const char ***argv, int
> > *argc, int *envchanged) *envchanged = 1;
> > } else if (!strcmp(cmd, "--no-replace-objects")) {
> > read_replace_refs = 0;
> > + setenv(NO_REPLACE_OBJECTS_ENVIRONMENT, "", 1);
>
> It is safer to set to a non-empty string, e.g., "1".
Ok, I will use a non empty string.
> I think this variable should be added to the list in connect.c around
> line 630 so that it does not propagate to the remote end.
Ok, I have done that in the version I will send.
Thanks,
Christian.
^ permalink raw reply
* Re: [PATCH 1/2] replace: use a GIT_NO_REPLACE_OBJECTS env variable
From: Christian Couder @ 2009-11-18 6:49 UTC (permalink / raw)
To: Michael J Gruber
Cc: Junio C Hamano, git, Jakub Narebski, Johannes Sixt, bill lam,
Andreas Schwab, Paul Mackerras
In-Reply-To: <4B026DE8.9070905@drmicha.warpmail.net>
On mardi 17 novembre 2009, Michael J Gruber wrote:
> Christian Couder venit, vidit, dixit 17.11.2009 06:11:
> > This environment variable is set when the --no-replace-objects
> > flag is passed to git, and it is read when other environment
> > variables are read.
> >
> > It is useful for example for scripts, as the git commands used in
> > them can now be aware that they must not read replace refs.
> >
> > Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
>
> Tested-by: Michael J Gruber <git@drmicha.warpmail.net>
>
> :) This works, thanks, as well as the gitk patch 2/2, which is difficult
> to cover by test scripts. Some OSes (or rather certain setenv/putenv
> variants) have problems distinguishing an unset variable from an empty
> one. I think we've worked around this, but avoiding it is safer, as J6t
> pointed out.
Ok.
Thanks for testing,
Christian.
^ permalink raw reply
* [PATCH v2 1/2] replace: use a GIT_NO_REPLACE_OBJECTS env variable
From: Christian Couder @ 2009-11-18 6:50 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, Michael J Gruber, Jakub Narebski, Johannes Sixt, bill lam,
Andreas Schwab, Paul Mackerras
This environment variable is set when the --no-replace-objects
flag is passed to git, and it is read when other environment
variables are read.
It is useful for example for scripts, as the git commands used in
them can now be aware that they must not read replace refs.
The GIT_NO_REPLACE_OBJECTS is set to "1" instead of "" as it is
safer on some platforms, thanks to Johannes Sixt and Michael J
Gruber.
Tested-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
cache.h | 1 +
connect.c | 1 +
environment.c | 2 ++
git.c | 3 +++
t/t6050-replace.sh | 17 +++++++++++++++++
5 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/cache.h b/cache.h
index 71a731d..bc77909 100644
--- a/cache.h
+++ b/cache.h
@@ -369,6 +369,7 @@ static inline enum object_type object_type(unsigned int mode)
#define CONFIG_ENVIRONMENT "GIT_CONFIG"
#define EXEC_PATH_ENVIRONMENT "GIT_EXEC_PATH"
#define CEILING_DIRECTORIES_ENVIRONMENT "GIT_CEILING_DIRECTORIES"
+#define NO_REPLACE_OBJECTS_ENVIRONMENT "GIT_NO_REPLACE_OBJECTS"
#define GITATTRIBUTES_FILE ".gitattributes"
#define INFOATTRIBUTES_FILE "info/attributes"
#define ATTRIBUTE_MACRO_PREFIX "[attr]"
diff --git a/connect.c b/connect.c
index 7945e38..c4f134f 100644
--- a/connect.c
+++ b/connect.c
@@ -630,6 +630,7 @@ struct child_process *git_connect(int fd[2], const char *url_orig,
GIT_WORK_TREE_ENVIRONMENT,
GRAFT_ENVIRONMENT,
INDEX_ENVIRONMENT,
+ NO_REPLACE_OBJECTS_ENVIRONMENT,
NULL
};
conn->env = env;
diff --git a/environment.c b/environment.c
index 5de6837..279a38a 100644
--- a/environment.c
+++ b/environment.c
@@ -83,6 +83,8 @@ static void setup_git_env(void)
git_graft_file = getenv(GRAFT_ENVIRONMENT);
if (!git_graft_file)
git_graft_file = git_pathdup("info/grafts");
+ if (read_replace_refs && getenv(NO_REPLACE_OBJECTS_ENVIRONMENT))
+ read_replace_refs = 0;
}
int is_bare_repository(void)
diff --git a/git.c b/git.c
index bd2c5fe..d50bbc3 100644
--- a/git.c
+++ b/git.c
@@ -89,6 +89,9 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
*envchanged = 1;
} else if (!strcmp(cmd, "--no-replace-objects")) {
read_replace_refs = 0;
+ setenv(NO_REPLACE_OBJECTS_ENVIRONMENT, "1", 1);
+ if (envchanged)
+ *envchanged = 1;
} else if (!strcmp(cmd, "--git-dir")) {
if (*argc < 2) {
fprintf(stderr, "No directory given for --git-dir.\n" );
diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh
index d4818b4..203ffdb 100755
--- a/t/t6050-replace.sh
+++ b/t/t6050-replace.sh
@@ -77,6 +77,11 @@ test_expect_success 'test --no-replace-objects option' '
git --no-replace-objects show $HASH2 | grep "A U Thor"
'
+test_expect_success 'test GIT_NO_REPLACE_OBJECTS env variable' '
+ GIT_NO_REPLACE_OBJECTS=1 git cat-file commit $HASH2 | grep "author A U Thor" &&
+ GIT_NO_REPLACE_OBJECTS=1 git show $HASH2 | grep "A U Thor"
+'
+
cat >tag.sig <<EOF
object $HASH2
type commit
@@ -202,6 +207,18 @@ test_expect_success 'fetch branch with replacement' '
cd ..
'
+test_expect_success 'bisect and replacements' '
+ git bisect start $HASH7 $HASH1 &&
+ test "$S" = "$(git rev-parse --verify HEAD)" &&
+ git bisect reset &&
+ GIT_NO_REPLACE_OBJECTS=1 git bisect start $HASH7 $HASH1 &&
+ test "$HASH4" = "$(git rev-parse --verify HEAD)" &&
+ git bisect reset &&
+ git --no-replace-objects bisect start $HASH7 $HASH1 &&
+ test "$HASH4" = "$(git rev-parse --verify HEAD)" &&
+ git bisect reset
+'
+
#
#
test_done
--
1.6.5.1.gaf97d
^ permalink raw reply related
* [PATCH v2 2/2] gitk: add --no-replace-objects option
From: Christian Couder @ 2009-11-18 6:50 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, Michael J Gruber, Jakub Narebski, Johannes Sixt, bill lam,
Andreas Schwab, Paul Mackerras
This option simply sets the GIT_NO_REPLACE_OBJECTS environment
variable, and that is enough to make gitk ignore replace refs.
The GIT_NO_REPLACE_OBJECTS is set to "1" instead of "" as it is
safer on some platforms, thanks to Johannes Sixt and Michael J
Gruber.
Tested-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
gitk-git/gitk | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index a0214b7..c586b93 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -128,7 +128,7 @@ proc unmerged_files {files} {
}
proc parseviewargs {n arglist} {
- global vdatemode vmergeonly vflags vdflags vrevs vfiltered vorigargs
+ global vdatemode vmergeonly vflags vdflags vrevs vfiltered vorigargs env
set vdatemode($n) 0
set vmergeonly($n) 0
@@ -208,6 +208,9 @@ proc parseviewargs {n arglist} {
# git rev-parse doesn't understand --merge
lappend revargs --gitk-symmetric-diff-marker MERGE_HEAD...HEAD
}
+ "--no-replace-objects" {
+ set env(GIT_NO_REPLACE_OBJECTS) "1"
+ }
"-*" {
# Other flag arguments including -<n>
if {[string is digit -strict [string range $arg 1 end]]} {
--
1.6.5.1.gaf97d
^ permalink raw reply related
* [PATCH v3] Expand ~ and ~user in core.excludesfile, commit.template
From: Matthieu Moy @ 2009-11-18 7:29 UTC (permalink / raw)
To: git, gitster; +Cc: Matthieu Moy, Karl Chen
In-Reply-To: <1258478665-8635-1-git-send-email-Matthieu.Moy@imag.fr>
These config variables are parsed to substitute ~ and ~user with getpw
entries.
user_path() refactored into new function expand_user_path(), to allow
dynamically allocating the return buffer.
Original patch by Karl Chen, modified by Matthieu Moy, and further
amended by Junio C Hamano.
Signed-off-by: Karl Chen <quarl@quarl.org>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
Since v2, I changed the code to use $HOME instead of the actual home
to expand ~.
This way, if you run "HOME=/else/where/ git status", then both
.gitconfig and ~/.gitignore will be taken from /else/where.
Documentation/config.txt | 7 +++-
builtin-commit.c | 2 +-
cache.h | 2 +
config.c | 12 ++++++-
path.c | 83 +++++++++++++++++++++++++++------------------
5 files changed, 69 insertions(+), 37 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index cb73d75..fb1740c 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -380,8 +380,9 @@ Common unit suffixes of 'k', 'm', or 'g' are supported.
core.excludesfile::
In addition to '.gitignore' (per-directory) and
'.git/info/exclude', git looks into this file for patterns
- of files which are not meant to be tracked. See
- linkgit:gitignore[5].
+ of files which are not meant to be tracked. "~/" is expanded
+ to the value of `$HOME` and "~user/" to the specified user's
+ home directory. See linkgit:gitignore[5].
core.editor::
Commands such as `commit` and `tag` that lets you edit
@@ -670,6 +671,8 @@ color.ui::
commit.template::
Specify a file to use as the template for new commit messages.
+ "~/" is expanded to the value of `$HOME` and "~user/" to the
+ specified user's home directory.
diff.autorefreshindex::
When using 'git-diff' to compare with work tree
diff --git a/builtin-commit.c b/builtin-commit.c
index d525b89..09d2840 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -999,7 +999,7 @@ static int git_commit_config(const char *k, const char *v, void *cb)
struct wt_status *s = cb;
if (!strcmp(k, "commit.template"))
- return git_config_string(&template_file, k, v);
+ return git_config_pathname(&template_file, k, v);
return git_status_config(k, v, s);
}
diff --git a/cache.h b/cache.h
index 71a731d..42f7cd8 100644
--- a/cache.h
+++ b/cache.h
@@ -645,6 +645,7 @@ int set_shared_perm(const char *path, int mode);
#define adjust_shared_perm(path) set_shared_perm((path), 0)
int safe_create_leading_directories(char *path);
int safe_create_leading_directories_const(const char *path);
+extern char *expand_user_path(const char *path);
char *enter_repo(char *path, int strict);
static inline int is_absolute_path(const char *path)
{
@@ -903,6 +904,7 @@ extern unsigned long git_config_ulong(const char *, const char *);
extern int git_config_bool_or_int(const char *, const char *, int *);
extern int git_config_bool(const char *, const char *);
extern int git_config_string(const char **, const char *, const char *);
+extern int git_config_pathname(const char **, const char *, const char *);
extern int git_config_set(const char *, const char *);
extern int git_config_set_multivar(const char *, const char *, const char *, int);
extern int git_config_rename_section(const char *, const char *);
diff --git a/config.c b/config.c
index c644061..b3d1ff4 100644
--- a/config.c
+++ b/config.c
@@ -351,6 +351,16 @@ int git_config_string(const char **dest, const char *var, const char *value)
return 0;
}
+int git_config_pathname(const char **dest, const char *var, const char *value)
+{
+ if (!value)
+ return config_error_nonbool(var);
+ *dest = expand_user_path(value);
+ if (!*dest)
+ die("Failed to expand user dir in: '%s'", value);
+ return 0;
+}
+
static int git_default_core_config(const char *var, const char *value)
{
/* This needs a better name */
@@ -474,7 +484,7 @@ static int git_default_core_config(const char *var, const char *value)
return git_config_string(&editor_program, var, value);
if (!strcmp(var, "core.excludesfile"))
- return git_config_string(&excludes_file, var, value);
+ return git_config_pathname(&excludes_file, var, value);
if (!strcmp(var, "core.whitespace")) {
if (!value)
diff --git a/path.c b/path.c
index 047fdb0..6351b57 100644
--- a/path.c
+++ b/path.c
@@ -11,6 +11,7 @@
* which is what it's designed for.
*/
#include "cache.h"
+#include "strbuf.h"
static char bad_path[] = "/bad-path/";
@@ -207,43 +208,49 @@ int validate_headref(const char *path)
return -1;
}
-static char *user_path(char *buf, char *path, int sz)
+static struct passwd *getpw_str(const char *username, size_t len)
{
struct passwd *pw;
- char *slash;
- int len, baselen;
+ char *username_z = xmalloc(len + 1);
+ memcpy(username_z, username, len);
+ username_z[len] = '\0';
+ pw = getpwnam(username_z);
+ free(username_z);
+ return pw;
+}
- if (!path || path[0] != '~')
- return NULL;
- path++;
- slash = strchr(path, '/');
- if (path[0] == '/' || !path[0]) {
- pw = getpwuid(getuid());
- }
- else {
- if (slash) {
- *slash = 0;
- pw = getpwnam(path);
- *slash = '/';
+/*
+ * Return a string with ~ and ~user expanded via getpw*. If buf != NULL,
+ * then it is a newly allocated string. Returns NULL on getpw failure or
+ * if path is NULL.
+ */
+char *expand_user_path(const char *path)
+{
+ struct strbuf user_path = STRBUF_INIT;
+ const char *first_slash = strchrnul(path, '/');
+ const char *to_copy = path;
+
+ if (path == NULL)
+ goto return_null;
+ if (path[0] == '~') {
+ const char *username = path + 1;
+ size_t username_len = first_slash - username;
+ if (username_len == 0) {
+ const char * home = getenv("HOME");
+ strbuf_add(&user_path, home, strlen(home));
+ } else {
+ struct passwd *pw = getpw_str(username, username_len);
+ if (!pw)
+ goto return_null;
+ strbuf_add(&user_path, pw->pw_dir, strlen(pw->pw_dir));
}
- else
- pw = getpwnam(path);
+ to_copy = first_slash;
}
- if (!pw || !pw->pw_dir || sz <= strlen(pw->pw_dir))
- return NULL;
- baselen = strlen(pw->pw_dir);
- memcpy(buf, pw->pw_dir, baselen);
- while ((1 < baselen) && (buf[baselen-1] == '/')) {
- buf[baselen-1] = 0;
- baselen--;
- }
- if (slash && slash[1]) {
- len = strlen(slash);
- if (sz <= baselen + len)
- return NULL;
- memcpy(buf + baselen, slash, len + 1);
- }
- return buf;
+ strbuf_add(&user_path, to_copy, strlen(to_copy));
+ return strbuf_detach(&user_path, NULL);
+return_null:
+ strbuf_release(&user_path);
+ return NULL;
}
/*
@@ -291,8 +298,18 @@ char *enter_repo(char *path, int strict)
if (PATH_MAX <= len)
return NULL;
if (path[0] == '~') {
- if (!user_path(used_path, path, PATH_MAX))
+ char *newpath = expand_user_path(path);
+ if (!newpath || (PATH_MAX - 10 < strlen(newpath))) {
+ free(newpath);
return NULL;
+ }
+ /*
+ * Copy back into the static buffer. A pity
+ * since newpath was not bounded, but other
+ * branches of the if are limited by PATH_MAX
+ * anyway.
+ */
+ strcpy(used_path, newpath); free(newpath);
strcpy(validated_path, path);
path = used_path;
}
--
1.6.5.2.152.gbbe9e
^ permalink raw reply related
* Re: [PATCH] Expand ~ and ~user in core.excludesfile, commit.template
From: Matthieu Moy @ 2009-11-18 7:24 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Andreas Schwab, Mike Hommey, Jeff King, git, Karl Chen
In-Reply-To: <7v8we4er0t.fsf@alter.siamese.dyndns.org>
> Andreas Schwab <schwab@linux-m68k.org> writes:
>
>> Mike Hommey <mh@glandium.org> writes:
>>
>> "~" should just expand to the value of $HOME, like in the shell,
>> independent of the real home directory of the real or effective user.
Right, I'll resend in a minute.
Junio C Hamano <gitster@pobox.com> writes:
> How should this interact with installations that run gitosis/gitlite that
> use shared account, giving user identity via the ssh key?
I guess there's some kind of rhetorical question behind that I missed,
but if a gitosis-like installation uses the user git, and the user foo
connects to it identifier by its SSH key, I don't see what you could
do other than expanding ~ to the homedir of git, which is $HOME at the
time your run git on the server.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply
* What's cooking in git.git (Nov 2009, #04; Tue, 17)
From: Junio C Hamano @ 2009-11-18 7:53 UTC (permalink / raw)
To: git
I'd like to tag 1.6.6-rc0 this coming weekend with most topics on 'next'
(and some from 'pu'), so that we can do the final 1.6.6 before the end of
the year.
It is likely that I'll be offline for most of the day tomorrow, even
though it will be my git Wednesday.
-- >8 --
Here are the topics that have been cooking. Commits prefixed with '-' are
only in 'pu' while commits prefixed with '+' are in 'next'. The ones
marked with '.' do not appear in any of the integration branches, but I am
still holding onto them.
In 1.7.0, we plan to correct handful of warts in the interfaces everybody
agrees that they were mistakes. The resulting system may not be strictly
backward compatible. Currently planned changes are:
* refuse push to update the checked out branch in a non-bare repo by
default
Make "git push" into a repository to update the branch that is checked
out fail by default. You can countermand this default by setting a
configuration variable in the receiving repository.
http://thread.gmane.org/gmane.comp.version-control.git/107758/focus=108007
* refuse push to delete the current branch by default
Make "git push $there :$killed" to delete the branch that is pointed at
by its HEAD fail by default. You can countermand this default by
setting a configuration variable in the receiving repository.
http://thread.gmane.org/gmane.comp.version-control.git/108862/focus=108936
* git-send-email won't make deep threads by default
Many people said that by default when sending more than 2 patches the
threading git-send-email makes by default is hard to read, and they
prefer the default be one cover letter and each patch as a direct
follow-up to the cover letter. You can countermand this by setting a
configuration variable.
http://article.gmane.org/gmane.comp.version-control.git/109790
* git-status won't be "git-commit --dry-run" anymore
http://thread.gmane.org/gmane.comp.version-control.git/125989/focus=125993
* "git-diff -w --exit-code" will exit success if only differences it
found are whitespace changes that are stripped away from the output.
http://thread.gmane.org/gmane.comp.version-control.git/119731/focus=119751
I wasn't fully functioning for the past few days, so this round we have
only added new topics and new patches to existing ones, without changing
the status of individual topics very much.
--------------------------------------------------
[Graduated to "master"]
* bs/maint-pre-commit-hook-sample (2009-11-05) 1 commit.
(merged to 'next' on 2009-11-06 at d70f646)
+ pre-commit.sample: Diff against the empty tree when HEAD is invalid
* js/maint-diff-color-words (2009-10-30) 3 commits.
(merged to 'next' on 2009-11-10 at 5619714)
+ diff --color-words: bit of clean-up
+ diff --color-words -U0: fix the location of hunk headers
+ t4034-diff-words: add a test for word diff without context
Fixes a corner case of running --color-words with -U0.
* sc/difftool-p4merge (2009-10-28) 1 commit
(merged to 'next' on 2009-10-31 at 194b5c5)
+ mergetool--lib: add p4merge as a pre-configured mergetool option
I do not do p4 nor use difftool, so it's much easier for me to merge this
to 'master' and wait for anybody to scream if there is breakage.
* jk/maint-add-p-empty (2009-10-27) 1 commit.
(merged to 'next' on 2009-10-30 at 2bd302f)
+ add-interactive: handle deletion of empty files
* lt/revision-bisect (2009-10-27) 1 commit.
(merged to 'next' on 2009-10-30 at 81ee52b)
+ Add '--bisect' revision machinery argument
* rs/pretty-wrap (2009-11-08) 2 commits
(merged to 'next' on 2009-11-08 at 8973fd8)
+ log --format: don't ignore %w() at the start of format string
(merged to 'next' on 2009-10-30 at 403bbfe)
+ Implement wrap format %w() as if it is a mode switch
(this branch uses js/log-rewrap.)
* js/log-rewrap (2009-10-18) 3 commits
(merged to 'next' on 2009-10-30 at 403bbfe)
+ Teach --wrap to only indent without wrapping
+ Add strbuf_add_wrapped_text() to utf8.[ch]
+ print_wrapped_text(): allow hard newlines
(this branch is used by rs/pretty-wrap.)
* fc/doc-fast-forward (2009-10-24) 1 commit.
(merged to 'next' on 2009-11-01 at faaad90)
+ Use 'fast-forward' all over the place
* tz/maint-rpm (2009-11-11) 1 commit.
+ Makefile: Ensure rpm packages can be read by older rpm versions
* np/maint-sideband-favor-status (2009-11-11) 1 commit.
(merged to 'next' on 2009-11-15 at 3ecd874)
+ give priority to progress messages
* sb/tutorial-test (2009-11-06) 4 commits
(merged to 'next' on 2009-11-15 at 5c82651)
+ t1200: prepare for merging with Fast-forward bikeshedding
+ t1200: further modernize test script style
+ t1200: Make documentation and test agree
+ t1200: cleanup and modernize test style
* ef/msys-imap (2009-10-22) 9 commits.
(merged to 'next' on 2009-10-31 at 8630603)
+ Windows: use BLK_SHA1 again
+ MSVC: Enable OpenSSL, and translate -lcrypto
+ mingw: enable OpenSSL
+ mingw: wrap SSL_set_(w|r)fd to call _get_osfhandle
+ imap-send: build imap-send on Windows
+ imap-send: fix compilation-error on Windows
+ imap-send: use run-command API for tunneling
+ imap-send: use separate read and write fds
+ imap-send: remove useless uid code
--------------------------------------------------
[New Topics]
* jn/faster-completion-startup (2009-11-17) 1 commit.
- Speed up bash completion loading
* th/maint-remote-update-help-string (2009-11-15) 1 commit.
- Update 'git remote update' usage string to match man page.
* tr/maint-merge-ours-clarification (2009-11-15) 3 commits.
- rebase: refuse to rebase with -s ours
(merged to 'next' on 2009-11-17 at 3291125)
+ rebase docs: clarify --merge and --strategy
+ Documentation: clarify 'ours' merge strategy
* tc/format-attribute (2009-11-14) 1 commit
- Check the format of more printf-type functions
* jk/maint-break-rename-reduce-memory (2009-11-16) 2 commits.
(merged to 'next' on 2009-11-16 at 5b5a93f)
+ diffcore-break: save cnt_data for other phases
+ diffcore-break: free filespec data as we go
* bc/grep-i-F (2009-11-06) 1 commit.
(merged to 'next' on 2009-11-17 at a9b138c)
+ grep: Allow case insensitive search of fixed-strings
* mm/config-pathname-tilde-expand (2009-11-17) 1 commit.
(merged to 'next' on 2009-11-17 at 7ba213d)
+ Expand ~ and ~user in core.excludesfile, commit.template
* pb/maint-use-custom-perl (2009-11-17) 1 commit.
(merged to 'next' on 2009-11-17 at 1ee8d46)
+ Make sure $PERL_PATH is defined when the test suite is run.
* th/remote-usage (2009-11-16) 1 commit.
- git remote: Separate usage strings for subcommands
* mo/maint-crlf-doc (2009-11-14) 1 commit.
(merged to 'next' on 2009-11-17 at abd9133)
+ core.autocrlf documentation: mention the crlf attribute
--------------------------------------------------
[Stalled]
* rj/cygwin-msvc (2009-11-09) 3 commits.
- Add explicit Cygwin check to guard WIN32 header inclusion
- MSVC: Add support for building with NO_MMAP
- Makefile: keep MSVC and Cygwin configuration separate
(this branch uses rj/maint-simplify-cygwin-makefile.)
I think J6t was not happy with the tip one.
* jc/fix-tree-walk (2009-10-22) 11 commits.
(merged to 'next' on 2009-10-22 at 10c0c8f)
+ Revert failed attempt since 353c5ee
+ read-tree --debug-unpack
(merged to 'next' on 2009-10-11 at 0b058e2)
+ unpack-trees.c: look ahead in the index
+ unpack-trees.c: prepare for looking ahead in the index
+ Aggressive three-way merge: fix D/F case
+ traverse_trees(): handle D/F conflict case sanely
+ more D/F conflict tests
+ tests: move convenience regexp to match object names to test-lib.sh
+ unpack_callback(): use unpack_failed() consistently
+ unpack-trees: typofix
+ diff-lib.c: fix misleading comments on oneway_diff()
This has some stupid bugs and temporarily reverted from 'next' until I can
fix it, but the "temporarily" turned out to be very loooong. Sigh...
* jh/notes (2009-10-09) 22 commits.
- fast-import: Proper notes tree manipulation using the notes API
- Refactor notes concatenation into a flexible interface for combining notes
- Notes API: Allow multiple concurrent notes trees with new struct notes_tree
- Notes API: for_each_note(): Traverse the entire notes tree with a callback
- Notes API: get_note(): Return the note annotating the given object
- Notes API: add_note(): Add note objects to the internal notes tree structure
- Notes API: init_notes(): Initialize the notes tree from the given notes ref
- Notes API: get_commit_notes() -> format_note() + remove the commit restriction
(merged to 'next' on 2009-11-01 at 948327a)
+ Add selftests verifying concatenation of multiple notes for the same commit
+ Refactor notes code to concatenate multiple notes annotating the same object
+ Add selftests verifying that we can parse notes trees with various fanouts
+ Teach the notes lookup code to parse notes trees with various fanout schemes
+ Teach notes code to free its internal data structures on request
+ Add '%N'-format for pretty-printing commit notes
+ Add flags to get_commit_notes() to control the format of the note string
+ t3302-notes-index-expensive: Speed up create_repo()
+ fast-import: Add support for importing commit notes
+ Teach "-m <msg>" and "-F <file>" to "git notes edit"
+ Add an expensive test for git-notes
+ Speed up git notes lookup
+ Add a script to edit/inspect notes
+ Introduce commit notes
I somehow thought that the later API part was waiting for updates but
nothing seems to be happening.
* jn/gitweb-blame (2009-09-01) 5 commits.
- gitweb: Minify gitweb.js if JSMIN is defined
- gitweb: Create links leading to 'blame_incremental' using JavaScript
(merged to 'next' on 2009-10-11 at 73c4a83)
+ gitweb: Colorize 'blame_incremental' view during processing
+ gitweb: Incremental blame (using JavaScript)
+ gitweb: Add optional "time to generate page" info in footer
Ajax-y blame. Any progress or RFH?
* sr/gfi-options (2009-09-06) 6 commits.
- fast-import: test the new option command
- fast-import: add option command
- fast-import: test the new feature command
- fast-import: add feature command
- fast-import: put marks reading in it's own function
- fast-import: put option parsing code in separate functions
It seemed to be moving again soon, but nothing has happened yet...
* je/send-email-no-subject (2009-08-05) 1 commit.
(merged to 'next' on 2009-10-11 at 1b99c56)
+ send-email: confirm on empty mail subjects
The existing tests cover the positive case (i.e. as long as the user says
"yes" to the "do you really want to send this message that lacks subject",
the message is sent) of this feature, but the feature itself needs its own
test to verify the negative case (i.e. does it correctly stop if the user
says "no"?)
--------------------------------------------------
[Cooking]
* jp/fetch-cull-many-refs (2009-11-13) 3 commits
(merged to 'next' on 2009-11-15 at db0f967)
+ remote: fix use-after-free error detected by glibc in ref_remove_duplicates
(merged to 'next' on 2009-11-01 at 1f09ce9)
+ fetch: Speed up fetch of large numbers of refs
+ remote: Make ref_remove_duplicates faster for large numbers of refs
Soon in 'master'.
* jn/help-everywhere (2009-11-09) 21 commits
(merged to 'next' on 2009-11-17 at 3a2dffe)
+ diff --no-index: make the usage string less scary
+ merge-{recursive,subtree}: use usagef() to print usage
+ Introduce usagef() that takes a printf-style format
+ Let 'git <command> -h' show usage without a git dir
+ Show usage string for 'git http-push -h'
+ Let 'git http-fetch -h' show usage outside any git repository
+ Show usage string for 'git stripspace -h'
+ Show usage string for 'git unpack-file -h'
+ Show usage string for 'git show-index -h'
+ Show usage string for 'git rev-parse -h'
+ Show usage string for 'git merge-one-file -h'
+ Show usage string for 'git mailsplit -h'
+ Show usage string for 'git imap-send -h'
+ Show usage string for 'git get-tar-commit-id -h'
+ Show usage string for 'git fast-import -h'
+ Show usage string for 'git check-ref-format -h'
+ Show usage string for 'git show-ref -h'
+ Show usage string for 'git merge-ours -h'
+ Show usage string for 'git commit-tree -h'
+ Show usage string for 'git cherry -h'
+ Show usage string for 'git grep -h'
(this branch uses jn/maint-http-fetch-mingw and jn/remove-fetch--tool.)
There were unrelated but still worthy fixes, so I reordered some of them;
also the "usage()" change is different from the one that was posted (see
my comment in $gmane/132592).
* jn/maint-http-fetch-mingw (2009-11-09) 1 commit.
(merged to 'next' on 2009-11-17 at cd35125)
+ http-fetch: add missing initialization of argv0_path
(this branch is used by jn/help-everywhere.)
* jn/remove-fetch--tool (2009-11-09) 1 commit
(merged to 'next' on 2009-11-17 at 72f6c3b)
+ Retire fetch--tool helper to contrib/examples
(this branch is used by jn/help-everywhere.)
These two were originally part of the "help-everywhere" topic but
they can stand on their own.
* jc/log-stdin (2009-11-03) 1 commit
- Teach --stdin option to "log" family
This is not signed-off (see $gmane/131971 for list of things you can do to
help advancing this topic).
* jn/gitweb-log-history (2009-11-13) 3 commits
(merged to 'next' on 2009-11-17 at d225f7d)
+ gitweb: Make 'history' view (re)use git_log_generic()
+ gitweb: Refactor common parts of 'log' and 'shortlog' views
+ gitweb: Refactor 'log' action generation, adding git_log_body()
* jn/rfc-pull-rebase-error-message (2009-11-12) 1 commit
- git-pull.sh --rebase: overhaul error handling when no candidates are found
I heard this needs at least retitling among other changes?
* rg/doc-workflow (2009-11-17) 4 commits.
- [Further RFC updates from Raman]
- [An RFC fix-up to further reword release section]
- Corrections to release management section in gitworkflows.txt
- Add branch management for releases to gitworkflows
The top three patches are meant to be squashed into the first one.
* sb/ls-tree-parseopt (2009-11-13) 2 commits.
(merged to 'next' on 2009-11-17 at c383204)
+ ls-tree: migrate to parse-options
+ t3101: test more ls-tree options
* jl/submodule-add-noname (2009-09-22) 1 commit.
(merged to 'next' on 2009-11-15 at 3a77d01)
+ git submodule add: make the <path> parameter optional
Dscho started an interesting discussion regarding the larger workflow in
which the "submodule add" is used. I think the patch itself makes sense
but at the same time it probably makes sense to also take the <path> and
infer the <repository> as Dscho suggested, probably in "git submodule
add", not in "git add" proper, at least initially.
* sc/protocol-doc (2009-11-03) 1 commit.
(merged to 'next' on 2009-11-15 at 32d6de8)
+ Update packfile transfer protocol documentation
* tr/filter-branch (2009-11-10) 2 commits.
(merged to 'next' on 2009-11-15 at 79c6a1d)
+ filter-branch: nearest-ancestor rewriting outside subdir filter
+ filter-branch: stop special-casing $filter_subdir argument
Updated again. Looked sane, except that the option might not be
necessary, but that can be fixed while in 'next'.
* em/commit-claim (2009-11-04) 1 commit
- commit -c/-C/--amend: reset timestamp and authorship to committer with --reset-author
I just picked better bits from both versions, but this needs to be
rethought.
* bg/format-patch-doc-update (2009-11-07) 4 commits.
(merged to 'next' on 2009-11-17 at 68b9056)
+ format-patch: Add "--no-stat" as a synonym for "-p"
+ format-patch documentation: Fix formatting
+ format-patch documentation: Remove diff options that are not useful
+ format-patch: Always generate a patch
Looked sensible, even though this may want to wait for 1.7.0. We'll see.
* rj/maint-simplify-cygwin-makefile (2009-10-27) 1 commit.
- Makefile: merge two Cygwin configuration sections into one
(this branch is used by rj/cygwin-msvc.)
This is one of the most obviously correct bit from "Compiling on Cygwin
using MSVC fails" topic.
* bg/fetch-multi (2009-11-10) 9 commits.
- Re-implement 'git remote update' using 'git fetch'
- builtin-fetch: add --dry-run option
- builtin-fetch: add --prune option
- teach warn_dangling_symref to take a FILE argument
- remote: refactor some logic into get_stale_heads()
- Add missing test for 'git remote update --prune'
- Add the configuration option skipFetchAll
- Teach the --multiple option to 'git fetch'
- Teach the --all option to 'git fetch'
* cc/bisect-doc (2009-11-08) 1 commit
- Documentation: add "Fighting regressions with git bisect" article
Any comments? Should it go to Documentation/technical instead?
* jn/editor-pager (2009-10-30) 9 commits
(merged to 'next' on 2009-11-15 at 7f3e3ae)
+ Provide a build time default-pager setting
+ Provide a build time default-editor setting
+ am -i, git-svn: use "git var GIT_PAGER"
+ add -i, send-email, svn, p4, etc: use "git var GIT_EDITOR"
+ Teach git var about GIT_PAGER
+ Teach git var about GIT_EDITOR
+ Suppress warnings from "git var -l"
+ Do not use VISUAL editor on dumb terminals
+ Handle more shell metacharacters in editor names
* bw/autoconf-more (2009-11-04) 2 commits
(merged to 'next' on 2009-11-15 at e86a8c9)
+ configure: add settings for gitconfig, editor and pager
+ configure: add macro to set arbitrary make variables
This will follow jn/editor-pager series.
* sr/vcs-helper (2009-11-18) 12 commits
- Add Python support library for remote helpers
- Basic build infrastructure for Python scripts
- Allow helpers to report in "list" command that the ref is unchanged
- Fix various memory leaks in transport-helper.c
- Allow helper to map private ref names into normal names
- Add support for "import" helper command
- Allow specifying the remote helper in the url
- Add a config option for remotes to specify a foreign vcs
- Allow fetch to modify refs
- Use a function to determine whether a remote is valid
- Allow programs to not depend on remotes having urls
- Fix memory leak in helper method for disconnect
Replaced again.
* mr/gitweb-snapshot (2009-11-07) 4 commits.
- gitweb: Smarter snapshot names
- gitweb: Document current snapshot rules via new tests
- t/gitweb-lib.sh: Split gitweb output into headers and body
(merged to 'next' on 2009-10-11 at 22ba047)
+ gitweb: check given hash before trying to create snapshot
Replaced commits near the tip with recent updates.
* jc/pretty-lf (2009-10-04) 1 commit.
- Pretty-format: %[+-]x to tweak inter-item newlines
* ks/precompute-completion (2009-11-15) 4 commits.
(merged to 'next' on 2009-11-15 at 23cdb96)
+ Revert ks/precompute-completion series
(merged to 'next' on 2009-10-28 at cd5177f)
+ completion: ignore custom merge strategies when pre-generating
(merged to 'next' on 2009-10-22 at f46a28a)
+ bug: precomputed completion includes scripts sources
(merged to 'next' on 2009-10-14 at adf722a)
+ Speedup bash completion loading
Reverted out of 'next', to be replaced with jn/faster-completion-startup
topic.
* sp/smart-http (2009-11-14) 37 commits
(merged to 'next' on 2009-11-17 at 11067eb)
+ http-backend: Let gcc check the format of more printf-type functions.
+ http-backend: Fix access beyond end of string.
(merged to 'next' on 2009-11-15 at 2a326b2)
+ http-backend: Fix bad treatment of uintmax_t in Content-Length
+ t5551-http-fetch: Work around broken Accept header in libcurl
+ t5551-http-fetch: Work around some libcurl versions
+ http-backend: Protect GIT_PROJECT_ROOT from /../ requests
+ Git-aware CGI to provide dumb HTTP transport
(merged to 'next' on 2009-11-06 at 666837c)
+ http-backend: Test configuration options
+ http-backend: Use http.getanyfile to disable dumb HTTP serving
+ test smart http fetch and push
+ http tests: use /dumb/ URL prefix
+ set httpd port before sourcing lib-httpd
+ t5540-http-push: remove redundant fetches
+ Smart HTTP fetch: gzip requests
+ Smart fetch over HTTP: client side
+ Smart push over HTTP: client side
+ Discover refs via smart HTTP server when available
+ http-backend: more explict LocationMatch
+ http-backend: add example for gitweb on same URL
+ http-backend: use mod_alias instead of mod_rewrite
+ http-backend: reword some documentation
+ http-backend: add GIT_PROJECT_ROOT environment var
+ Smart fetch and push over HTTP: server side
+ Add stateless RPC options to upload-pack, receive-pack
+ Git-aware CGI to provide dumb HTTP transport
+ remote-helpers: return successfully if everything up-to-date
+ Move WebDAV HTTP push under remote-curl
+ remote-helpers: Support custom transport options
+ remote-helpers: Fetch more than one ref in a batch
+ fetch: Allow transport -v -v -v to set verbosity to 3
+ remote-curl: Refactor walker initialization
+ Add multi_ack_detailed capability to fetch-pack/upload-pack
+ Move "get_ack()" back to fetch-pack
+ fetch-pack: Use a strbuf to compose the want list
+ pkt-line: Make packet_read_line easier to debug
+ pkt-line: Add strbuf based functions
+ http-push: fix check condition on http.c::finish_http_pack_request()
* nd/sparse (2009-08-20) 19 commits.
- sparse checkout: inhibit empty worktree
- Add tests for sparse checkout
- read-tree: add --no-sparse-checkout to disable sparse checkout support
- unpack-trees(): ignore worktree check outside checkout area
- unpack_trees(): apply $GIT_DIR/info/sparse-checkout to the final index
- unpack-trees(): "enable" sparse checkout and load $GIT_DIR/info/sparse-checkout
- unpack-trees.c: generalize verify_* functions
- unpack-trees(): add CE_WT_REMOVE to remove on worktree alone
- Introduce "sparse checkout"
- dir.c: export excluded_1() and add_excludes_from_file_1()
- excluded_1(): support exclude files in index
- unpack-trees(): carry skip-worktree bit over in merged_entry()
- Read .gitignore from index if it is skip-worktree
- Avoid writing to buffer in add_excludes_from_file_1()
- Teach Git to respect skip-worktree bit (writing part)
- Teach Git to respect skip-worktree bit (reading part)
- Introduce "skip-worktree" bit in index, teach Git to get/set this bit
- Add test-index-version
- update-index: refactor mark_valid() in preparation for new options
The latest update I didn't look at very closely but I had an impression
that it was touching very generic codepath that would affect non sparse
cases, iow the patch looked very scary (the entire series already is).
--------------------------------------------------
[For 1.7.0]
* jc/1.7.0-no-commit-no-ff-2 (2009-10-22) 1 commit.
- git-merge: forbid fast-forward and up-to-date when --no-commit is given
This makes "git merge --no-commit" fail when it results in fast-forward or
up-to-date. I haven't described this at the beginning of this message
yet, as it is not clear if this change is even necessary. Opinions?
* jk/1.7.0-status (2009-09-05) 5 commits.
- docs: note that status configuration affects only long format
(merged to 'next' on 2009-10-11 at 65c8513)
+ commit: support alternate status formats
+ status: add --porcelain output format
+ status: refactor format option parsing
+ status: refactor short-mode printing to its own function
(this branch uses jc/1.7.0-status.)
Gives the --short output format to post 1.7.0 "git commit --dry-run" that
is similar to that of post 1.7.0 "git status".
The tip one is not in 'next' as I have been hoping that somebody may want
to change the code to make it unnecessary, but it does not seem to be
happening, so probably it should also go to 'next'.
* jc/1.7.0-status (2009-09-05) 4 commits.
(merged to 'next' on 2009-10-11 at 9558627)
+ status: typo fix in usage
+ git status: not "commit --dry-run" anymore
+ git stat -s: short status output
+ git stat: the beginning of "status that is not a dry-run of commit"
(this branch is used by jk/1.7.0-status.)
With this, "git status" is no longer "git commit --dry-run".
* jc/1.7.0-send-email-no-thread-default (2009-08-22) 1 commit.
(merged to 'next' on 2009-10-11 at 043acdf)
+ send-email: make --no-chain-reply-to the default
* jc/1.7.0-diff-whitespace-only-status (2009-08-30) 4 commits.
(merged to 'next' on 2009-10-11 at 546c74d)
+ diff.c: fix typoes in comments
+ Make test case number unique
+ diff: Rename QUIET internal option to QUICK
+ diff: change semantics of "ignore whitespace" options
This changes exit code from "git diff --ignore-whitespace" and friends
when there is no actual output. It is a backward incompatible change, but
we could argue that it is a bugfix.
* jc/1.7.0-push-safety (2009-02-09) 2 commits.
(merged to 'next' on 2009-10-11 at 81b8128)
+ Refuse deleting the current branch via push
+ Refuse updating the current branch in a non-bare repository via push
--------------------------------------------------
[I have been too busy to purge these]
* ne/rev-cache (2009-10-19) 7 commits.
. support for commit grafts, slight change to general mechanism
. support for path name caching in rev-cache
. full integration of rev-cache into git, completed test suite
. administrative functions for rev-cache, start of integration into git
. support for non-commit object caching in rev-cache
. basic revision cache system, no integration or features
. man page and technical discussion for rev-cache
The author indicated that there is another round coming. Does not seem to
pass the tests when merged to 'pu', so it has been ejected for now.
* jc/log-tz (2009-03-03) 1 commit.
- Allow --date=local --date=other-format to work as expected
Maybe some people care about this. I dunno.
* jc/mailinfo-remove-brackets (2009-07-15) 1 commit.
- mailinfo: -b option keeps [bracketed] strings that is not a [PATCH] marker
Maybe some people care about this. I dunno.
* pb/gitweb-no-project-list (2009-11-06) 3 commits.
. gitweb: Polish the content tags support
. gitweb: Support for no project list on gitweb front page
. gitweb: Refactor project list routines
I picked these up but didn't queue as Warthog9's comments made certain
amount of sense to me.
^ permalink raw reply
* Re: [RFC PATCH 1/6] gitweb: Hyperlink committags in a commit message by regex matching
From: Petr Baudis @ 2009-11-18 8:20 UTC (permalink / raw)
To: Marcel M. Cary; +Cc: Jakub Narebski, git, Giuseppe Bilotta, Francis Galiegue
In-Reply-To: <1258525350-5528-2-git-send-email-marcel@oak.homeunix.org>
On Tue, Nov 17, 2009 at 10:22:25PM -0800, Marcel M. Cary wrote:
> One additional thing that occured to me is that maybe the hyperlinks
> added by committags should have 'rel="nofollow"' by default? And if
> so, maybe that needs to be configurable? On the other hand, I'm not
> sure how useful it is to hide real URLs in the commit messages from
> search engines... ?
I don't think rel="nofollow" is necessary.
BTW, wouldn't it be useful to do the matching in blob bodies as well?
And is it sensible to call these "committags" at all then? I already
made the mistake of calling content tags "ctags" and I regret it; I
think calling yet another thing tags after git tags and ctags is almost
unbearable.
> diff --git a/gitweb/INSTALL b/gitweb/INSTALL
> index b76a0cf..9081ed8 100644
> --- a/gitweb/INSTALL
> +++ b/gitweb/INSTALL
> @@ -132,6 +132,11 @@ adding the following lines to your $GITWEB_CONFIG:
> $known_snapshot_formats{'zip'}{'disabled'} = 1;
> $known_snapshot_formats{'tgz'}{'compressor'} = ['gzip','-6'];
>
> +To add a committag to the default list of commit tags, for example to
> +enable hyperlinking of bug numbers to a bug tracker for all projects:
> +
> + push @{$feature{'committags'}{'default'}}, 'bugzilla';
> +
>
> Gitweb repositories
> -------------------
I think this is not useful at all, since:
(i) The user will also *always* need to override the URL.
(ii) More importantly, the user has no idea what on earth commit
tags are.
Could you please prepend this paragraph with a short committags
description, e.g.:
"Gitweb can rewrite certain snippets of text in commit messages
to hyperlinks, e.g. URL addresses or bug tracker references - we
call these snippets 'committags'."
And you should also add
$committags{'buzilla'}{'options'}{'url'} = ...
to the explanation, together with a reference to the appropriate part of
gitweb.perl for more details.
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index e4cbfc3..2d72202 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -213,6 +213,97 @@ our %avatar_size = (
> 'double' => 32
> );
>
> +# In general, the site admin can enable/disable per-project
> +# configuration of each committag. Only the 'options' part of the
> +# committag is configurable per-project.
The exact same problem here - it is not explained what committag
actually is and where it applies.
> +# The site admin can of course add new tags to this hash or override
> +# the 'sub' key if necessary. But such changes may be fragile; this
> +# is not designed as a full-blown plugin architecture. The 'sub' must
> +# return a list of strings or string refs. The strings must contain
> +# plain text and the string refs must contain HTML. The string refs
> +# will not be processed further.
> +#
> +# For any committag, set the 'override' key to 1 to allow individual
> +# projects to override entries in the 'options' hash for that tag.
> +# For example, to match only commit hashes given in lowercase in one
> +# project, add this to the $GITWEB_CONFIG:
> +#
> +# $committags{'sha1'}{'override'} = 1;
> +#
> +# And in the project's config:
> +#
> +# gitweb.committags.sha1.pattern = \\b([0-9a-f]{8,40})\\b
> +#
> +# Some committags have additional options whose interpretation depends
> +# on the implementation of the 'sub' key. The hyperlink_committag
> +# value appends the first captured group to the 'url' option.
> +our %committags = (
> + # Link Git-style hashes to this gitweb
> + 'sha1' => {
> + 'options' => {
> + 'pattern' => qr/\b([0-9a-fA-F]{8,40})\b/,
> + },
> + 'override' => 0,
> + 'sub' => sub {
> + my ($opts, @match) = @_;
> + return \$cgi->a({-href => href(action=>"object", hash=>$match[1]),
> + -class => "text"},
> + esc_html($match[0], -nbsp=>1));
> + },
> + },
Ideally, a link should be made only in case the object exists, but this
is not trivial to implement without overhead of 1 exec per object, so I
guess it's fine to leave this for later (after all this feature was
already present). In that case, I think it would be useful to start
matching ids from 5 characters up - I use these quite frequently ;) -
but until then it would probably make for too much false positives.
> @@ -417,6 +508,21 @@ our %feature = (
> 'sub' => \&feature_avatar,
> 'override' => 0,
> 'default' => ['']},
> +
> + # The selection and ordering of committags that are enabled.
> + # Committag transformations will be applied to commit log messages
> + # in the order listed here if listed here.
You should add something like "See %committags definition above for
explanation of committags and pre-defined committag classes."
> + # To disable system wide have in $GITWEB_CONFIG
> + # $feature{'committags'}{'default'} = [];
> + # To have project specific config enable override in $GITWEB_CONFIG
> + # $feature{'committags'}{'override'} = 1;
> + # and in project config gitweb.committags = sha1, url, bugzilla
> + # to enable those three committags for that project
> + 'committags' => {
> + 'sub' => sub { feature_list('committags', @_) },
> + 'override' => 0,
> + 'default' => ['sha1']},
> );
Would people consider it harmful to add 'url' to the default set?
> @@ -463,16 +569,16 @@ sub feature_bool {
> }
> }
>
> -sub feature_snapshot {
> - my (@fmts) = @_;
> +sub feature_list {
> + my ($key, @defaults) = @_;
>
> - my ($val) = git_get_project_config('snapshot');
> + my ($cfg) = git_get_project_config($key);
>
> - if ($val) {
> - @fmts = ($val eq 'none' ? () : split /\s*[,\s]\s*/, $val);
> + if ($cfg) {
> + return ($cfg eq 'none' ? () : split(/\s*[,\s]\s*/, $cfg));
> }
>
> - return @fmts;
> + return @defaults;
> }
>
> sub feature_patches {
> @@ -886,6 +992,35 @@ if ($git_avatar eq 'gravatar') {
> $git_avatar = '';
> }
>
> +# ordering of committags
> +our @committags = gitweb_get_feature('committags');
> +
> +# whether we've loaded committags for the project yet
> +our $loaded_project_committags = 0;
> +
> +# Load committag configs from the repository config file and and
> +# incorporate them into the gitweb defaults where permitted by the
> +# site administrator.
> +sub gitweb_load_project_committags {
> + return if (!$git_dir || $loaded_project_committags);
When can it happen that this is called and !$git_dir? In case it could
ever happen, why not allow the configuration at least in global gitweb
file?
> + my %project_config = ();
> + my %raw_config = git_parse_project_config('gitweb\.committag');
> + foreach my $key (keys(%raw_config)) {
> + next if ($key !~ /gitweb\.committag\.[^.]+\.[^.]/);
> + my ($gitweb_prefix, $committag_prefix, $ctname, $option) =
> + split(/\./, $key, 4);
> + $project_config{$ctname}{$option} = $raw_config{$key};
> + }
> + foreach my $ctname (keys(%committags)) {
> + next if (!$committags{$ctname}{'override'});
> + foreach my $optname (keys %{$project_config{$ctname}}) {
> + $committags{$ctname}{'options'}{$optname} =
> + $project_config{$ctname}{$optname};
> + }
> + }
> + $loaded_project_committags = 1;
> +}
For the next-conditions, I'd prefer unless formulation, but I guess
that's purely a matter of taste.
> +sub push_or_append (\@@) {
> + my $fragments = shift;
> +
> + if (ref $_[0] || ! @$fragments || ref $fragments->[-1]) {
> + push @$fragments, @_;
> + } else {
> + my $a = pop @$fragments;
> + my $b = shift @_;
> +
> + push @$fragments, $a . $b, @_;
> + }
> + # imitate push
> + return scalar @$fragments;
This looks *quite* cryptic, a comment would be rather helpful.
--
Petr "Pasky" Baudis
A lot of people have my books on their bookshelves.
That's the problem, they need to read them. -- Don Knuth
^ permalink raw reply
* Re: What's cooking in git.git (Nov 2009, #04; Tue, 17)
From: Tay Ray Chuan @ 2009-11-18 8:22 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7v7hto46ce.fsf@alter.siamese.dyndns.org>
Hi,
On Wed, Nov 18, 2009 at 3:53 PM, Junio C Hamano <gitster@pobox.com> wrote:
> * sp/smart-http (2009-11-14) 37 commits
> [snip]
> + Git-aware CGI to provide dumb HTTP transport
hmm, it appears that this commit (92815b3) has an incorrect subject;
it should instead read "http-backend: Fix symbol clash on AIX 5.3"
(which is the first line in the commit message body).
It's from the email
From: "Shawn O. Pearce" <spearce@spearce.org>
To: git@vger.kernel.org
Subject: [PATCH 1/3] http-backend: Fix symbol clash on AIX 5.3
Date: Mon, 9 Nov 2009 10:10:35 -0800
Message-Id: <1257790237-30850-1-git-send-email-spearce@spearce.org>
--
Cheers,
Ray Chuan
^ permalink raw reply
* Re: [RFC PATCH 1/6] gitweb: Hyperlink committags in a commit message by regex matching
From: Petr Baudis @ 2009-11-18 8:26 UTC (permalink / raw)
To: Marcel M. Cary; +Cc: Jakub Narebski, git, Giuseppe Bilotta, Francis Galiegue
In-Reply-To: <1258525350-5528-2-git-send-email-marcel@oak.homeunix.org>
On Tue, Nov 17, 2009 at 10:22:25PM -0800, Marcel M. Cary wrote:
> + # Avoid matching punctuation that might immediately follow
> + # a url, is not part of the url, and is allowed in urls,
> + # like a full-stop ('.').
> + 'pattern' => qr!(https?|ftps?|git|ssh|ssh+git|sftp|smb|webdavs?|
> + nfs|irc|nntp|rsync)
> + ://[-_a-zA-Z0-9\@/&=+~#<>;%:.?]+
> + [-_a-zA-Z0-9\@/&=+~#<>]!x,
You meant ssh\+git here. ;-)
Petr "Pasky" Baudis
^ permalink raw reply
* [ANNOUNCE] codeBeamer MR - Easy ACL for Git
From: Intland Software @ 2009-11-18 8:33 UTC (permalink / raw)
To: git
codeBeamer MR is a new tool for teams working with Git, and striving for
fast repository management and easy access control management.
Setting up and maintaining ACL on top of Git is not trivial. With this
web based tool, you can *save a lot of boring and error-prone maintainenace
work*, and spend your time rather with coding.
FEATURES
* Starts and close projects and repositories in just seconds
* Project-, group-, and role-based administration across multiple repositories
* ACL on directory level
* SSH authentication
* Lightweight wiki, issue tracking and project management facilities
* Web based
* Remote API
PRICE?
It is *free* (as in beer). No expiration.
LEARN MORE & DOWNLOAD
More details, screenshots and downloads:
http://www.intland.com/products/cb-mr/overview.html
^ permalink raw reply
* Re: What's cooking in git.git (Nov 2009, #04; Tue, 17)
From: Johannes Sixt @ 2009-11-18 8:40 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7v7hto46ce.fsf@alter.siamese.dyndns.org>
Junio C Hamano schrieb:
> * rj/cygwin-msvc (2009-11-09) 3 commits.
> - Add explicit Cygwin check to guard WIN32 header inclusion
> - MSVC: Add support for building with NO_MMAP
> - Makefile: keep MSVC and Cygwin configuration separate
> (this branch uses rj/maint-simplify-cygwin-makefile.)
>
> I think J6t was not happy with the tip one.
Ramsay suggested to drop the one at the tip, and I agree. The other two
patches are good.
-- Hannes
^ permalink raw reply
* [PATCH v4] Expand ~ and ~user in core.excludesfile, commit.template
From: Matthieu Moy @ 2009-11-18 8:58 UTC (permalink / raw)
To: git, gitster; +Cc: Matthieu Moy, Karl Chen
In-Reply-To: <1258529351-4045-1-git-send-email-Matthieu.Moy@imag.fr>
These config variables are parsed to substitute ~ and ~user with getpw
entries.
user_path() refactored into new function expand_user_path(), to allow
dynamically allocating the return buffer.
Original patch by Karl Chen, modified by Matthieu Moy, and further
amended by Junio C Hamano.
Signed-off-by: Karl Chen <quarl@quarl.org>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
"Oops, I did it again :-("
Just a style issue since v3 (char * home -> char *home), sorry for the noise.
Documentation/config.txt | 7 +++-
builtin-commit.c | 2 +-
cache.h | 2 +
config.c | 12 ++++++-
path.c | 83 +++++++++++++++++++++++++++------------------
5 files changed, 69 insertions(+), 37 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 78ee906..b4fe843 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -380,8 +380,9 @@ Common unit suffixes of 'k', 'm', or 'g' are supported.
core.excludesfile::
In addition to '.gitignore' (per-directory) and
'.git/info/exclude', git looks into this file for patterns
- of files which are not meant to be tracked. See
- linkgit:gitignore[5].
+ of files which are not meant to be tracked. "~/" is expanded
+ to the value of `$HOME` and "~user/" to the specified user's
+ home directory. See linkgit:gitignore[5].
core.editor::
Commands such as `commit` and `tag` that lets you edit
@@ -681,6 +682,8 @@ color.ui::
commit.template::
Specify a file to use as the template for new commit messages.
+ "~/" is expanded to the value of `$HOME` and "~user/" to the
+ specified user's home directory.
diff.autorefreshindex::
When using 'git-diff' to compare with work tree
diff --git a/builtin-commit.c b/builtin-commit.c
index 0fd7af6..87d1b90 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -1175,7 +1175,7 @@ static int git_commit_config(const char *k, const char *v, void *cb)
struct wt_status *s = cb;
if (!strcmp(k, "commit.template"))
- return git_config_string(&template_file, k, v);
+ return git_config_pathname(&template_file, k, v);
return git_status_config(k, v, s);
}
diff --git a/cache.h b/cache.h
index f7533ff..2ba9690 100644
--- a/cache.h
+++ b/cache.h
@@ -649,6 +649,7 @@ int set_shared_perm(const char *path, int mode);
#define adjust_shared_perm(path) set_shared_perm((path), 0)
int safe_create_leading_directories(char *path);
int safe_create_leading_directories_const(const char *path);
+extern char *expand_user_path(const char *path);
char *enter_repo(char *path, int strict);
static inline int is_absolute_path(const char *path)
{
@@ -909,6 +910,7 @@ extern unsigned long git_config_ulong(const char *, const char *);
extern int git_config_bool_or_int(const char *, const char *, int *);
extern int git_config_bool(const char *, const char *);
extern int git_config_string(const char **, const char *, const char *);
+extern int git_config_pathname(const char **, const char *, const char *);
extern int git_config_set(const char *, const char *);
extern int git_config_set_multivar(const char *, const char *, const char *, int);
extern int git_config_rename_section(const char *, const char *);
diff --git a/config.c b/config.c
index 51f2208..37385ce 100644
--- a/config.c
+++ b/config.c
@@ -351,6 +351,16 @@ int git_config_string(const char **dest, const char *var, const char *value)
return 0;
}
+int git_config_pathname(const char **dest, const char *var, const char *value)
+{
+ if (!value)
+ return config_error_nonbool(var);
+ *dest = expand_user_path(value);
+ if (!*dest)
+ die("Failed to expand user dir in: '%s'", value);
+ return 0;
+}
+
static int git_default_core_config(const char *var, const char *value)
{
/* This needs a better name */
@@ -479,7 +489,7 @@ static int git_default_core_config(const char *var, const char *value)
return git_config_string(&editor_program, var, value);
if (!strcmp(var, "core.excludesfile"))
- return git_config_string(&excludes_file, var, value);
+ return git_config_pathname(&excludes_file, var, value);
if (!strcmp(var, "core.whitespace")) {
if (!value)
diff --git a/path.c b/path.c
index c7679be..2ec950b 100644
--- a/path.c
+++ b/path.c
@@ -11,6 +11,7 @@
* which is what it's designed for.
*/
#include "cache.h"
+#include "strbuf.h"
static char bad_path[] = "/bad-path/";
@@ -207,43 +208,49 @@ int validate_headref(const char *path)
return -1;
}
-static char *user_path(char *buf, char *path, int sz)
+static struct passwd *getpw_str(const char *username, size_t len)
{
struct passwd *pw;
- char *slash;
- int len, baselen;
+ char *username_z = xmalloc(len + 1);
+ memcpy(username_z, username, len);
+ username_z[len] = '\0';
+ pw = getpwnam(username_z);
+ free(username_z);
+ return pw;
+}
- if (!path || path[0] != '~')
- return NULL;
- path++;
- slash = strchr(path, '/');
- if (path[0] == '/' || !path[0]) {
- pw = getpwuid(getuid());
- }
- else {
- if (slash) {
- *slash = 0;
- pw = getpwnam(path);
- *slash = '/';
+/*
+ * Return a string with ~ and ~user expanded via getpw*. If buf != NULL,
+ * then it is a newly allocated string. Returns NULL on getpw failure or
+ * if path is NULL.
+ */
+char *expand_user_path(const char *path)
+{
+ struct strbuf user_path = STRBUF_INIT;
+ const char *first_slash = strchrnul(path, '/');
+ const char *to_copy = path;
+
+ if (path == NULL)
+ goto return_null;
+ if (path[0] == '~') {
+ const char *username = path + 1;
+ size_t username_len = first_slash - username;
+ if (username_len == 0) {
+ const char *home = getenv("HOME");
+ strbuf_add(&user_path, home, strlen(home));
+ } else {
+ struct passwd *pw = getpw_str(username, username_len);
+ if (!pw)
+ goto return_null;
+ strbuf_add(&user_path, pw->pw_dir, strlen(pw->pw_dir));
}
- else
- pw = getpwnam(path);
+ to_copy = first_slash;
}
- if (!pw || !pw->pw_dir || sz <= strlen(pw->pw_dir))
- return NULL;
- baselen = strlen(pw->pw_dir);
- memcpy(buf, pw->pw_dir, baselen);
- while ((1 < baselen) && (buf[baselen-1] == '/')) {
- buf[baselen-1] = 0;
- baselen--;
- }
- if (slash && slash[1]) {
- len = strlen(slash);
- if (sz <= baselen + len)
- return NULL;
- memcpy(buf + baselen, slash, len + 1);
- }
- return buf;
+ strbuf_add(&user_path, to_copy, strlen(to_copy));
+ return strbuf_detach(&user_path, NULL);
+return_null:
+ strbuf_release(&user_path);
+ return NULL;
}
/*
@@ -291,8 +298,18 @@ char *enter_repo(char *path, int strict)
if (PATH_MAX <= len)
return NULL;
if (path[0] == '~') {
- if (!user_path(used_path, path, PATH_MAX))
+ char *newpath = expand_user_path(path);
+ if (!newpath || (PATH_MAX - 10 < strlen(newpath))) {
+ free(newpath);
return NULL;
+ }
+ /*
+ * Copy back into the static buffer. A pity
+ * since newpath was not bounded, but other
+ * branches of the if are limited by PATH_MAX
+ * anyway.
+ */
+ strcpy(used_path, newpath); free(newpath);
strcpy(validated_path, path);
path = used_path;
}
--
1.6.5.2.152.gbbe9e
^ permalink raw reply related
* Re: git-svn of both trunk and tags while having no access to the 'parent' of those
From: Michael J Gruber @ 2009-11-18 9:01 UTC (permalink / raw)
To: Yaroslav Halchenko; +Cc: git
In-Reply-To: <20091117025945.GE17964@onerussian.com>
Yaroslav Halchenko venit, vidit, dixit 17.11.2009 03:59:
> Dear Git People,
>
> I've ran into a situation here:
>
> there is a repository with trunk and releases (analog to tags there)
> available for public, but the rest of directories and their parent is
> not available without authentication... ie I can access
>
> http://domain.com/svnrepo/trunk
> http://domain.com/svnrepo/releases
> but not
> http://domain.com/svnrepo/
>
> Whenever I use git-svn (1.6.5 in Debian):
>
> git svn clone --prefix=upstream-svn/ -T trunk -t releases http://domain.com/svnrepo svnrepo.gitsvn
>
> it asks for authentication... I guess, now I can only clone trunk and
> releases separately? or may be there is some way to avoid the
> problem, ie avoid looking 'into root'?
>
> Thanks in advance!
Your problem description seems to match perfectly with the description
of the "--no-minimize-url" option in git svn's man page. I'm sure it's
worth a try.
Michael
^ permalink raw reply
* [PATCH] Give the hunk comment its own color
From: Bert Wesarg @ 2009-11-18 11:30 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Bert Wesarg
Insired by the coloring of quilt.
Introduce a separate color for the hunk comment part, i.e. the current function.
Whitespace between hunk header and hunk comment is now printed as plain.
The current default is magenta. But I'm not settled on this. My favorite would
be bold yellow.
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
Documentation/config.txt | 8 +++---
combine-diff.c | 5 +++-
diff.c | 62 +++++++++++++++++++++++++++++++++++++++++++--
diff.h | 1 +
4 files changed, 68 insertions(+), 8 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index cb73d75..421cd50 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -598,10 +598,10 @@ color.diff.<slot>::
Use customized color for diff colorization. `<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), `new` (added lines),
- `commit` (commit headers), or `whitespace` (highlighting
- whitespace errors). The values of these variables may be specified as
- in color.branch.<slot>.
+ (hunk header), 'func' (function in hunk header), `old` (removed lines),
+ `new` (added lines), `commit` (commit headers), or `whitespace`
+ (highlighting whitespace errors). The values of these variables may be
+ specified as in color.branch.<slot>.
color.grep::
When set to `always`, always highlight matches. When `false` (or
diff --git a/combine-diff.c b/combine-diff.c
index 5b63af1..6162691 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -524,6 +524,7 @@ static void dump_sline(struct sline *sline, unsigned long cnt, int num_parent,
int i;
unsigned long lno = 0;
const char *c_frag = diff_get_color(use_color, DIFF_FRAGINFO);
+ const char *c_func = diff_get_color(use_color, DIFF_FUNCINFO);
const char *c_new = diff_get_color(use_color, DIFF_FILE_NEW);
const char *c_old = diff_get_color(use_color, DIFF_FILE_OLD);
const char *c_plain = diff_get_color(use_color, DIFF_PLAIN);
@@ -588,7 +589,9 @@ static void dump_sline(struct sline *sline, unsigned long cnt, int num_parent,
comment_end = i;
}
if (comment_end)
- putchar(' ');
+ printf("%s%s %s%s", c_reset,
+ c_plain, c_reset,
+ c_func);
for (i = 0; i < comment_end; i++)
putchar(hunk_comment[i]);
}
diff --git a/diff.c b/diff.c
index 0d7f5ea..8a5ed1b 100644
--- a/diff.c
+++ b/diff.c
@@ -39,6 +39,7 @@ static char diff_colors[][COLOR_MAXLEN] = {
GIT_COLOR_GREEN, /* NEW */
GIT_COLOR_YELLOW, /* COMMIT */
GIT_COLOR_BG_RED, /* WHITESPACE */
+ GIT_COLOR_MAGENTA, /* FUNCINFO */
};
static void diff_filespec_load_driver(struct diff_filespec *one);
@@ -60,6 +61,8 @@ static int parse_diff_color_slot(const char *var, int ofs)
return DIFF_COMMIT;
if (!strcasecmp(var+ofs, "whitespace"))
return DIFF_WHITESPACE;
+ if (!strcasecmp(var+ofs, "func"))
+ return DIFF_FUNCINFO;
die("bad config variable '%s'", var);
}
@@ -344,6 +347,61 @@ static void emit_add_line(const char *reset,
}
}
+static void emit_hunk_line(struct emit_callback *ecbdata,
+ const char *line, int len)
+{
+ const char *plain = diff_get_color(ecbdata->color_diff, DIFF_PLAIN);
+ const char *frag = diff_get_color(ecbdata->color_diff, DIFF_FRAGINFO);
+ const char *func = diff_get_color(ecbdata->color_diff, DIFF_FUNCINFO);
+ const char *reset = diff_get_color(ecbdata->color_diff, DIFF_RESET);
+ const char *part_end = NULL;
+ int part_len = 0;
+
+ /* determine length of @ */
+ while (part_len < len && line[part_len] == '@')
+ part_len++;
+
+ /* find end of frag, (Ie. find second @@) */
+ part_end = memmem(line + part_len, len - part_len,
+ line, part_len);
+ if (!part_end)
+ return emit_line(ecbdata->file, frag, reset, line, len);
+ /* go to end of @@ */
+ part_end += part_len;
+ /* calculate total length of frag */
+ part_len = part_end - line;
+ /* emit frag */
+ emit_line(ecbdata->file, frag, reset, line, part_len);
+
+ /* consume hunk header */
+ len -= part_len;
+ line += part_len;
+
+ /* return early */
+ if (!len)
+ return;
+
+ /* determine length of sep space */
+ part_len = 0;
+ while (part_len < len && isspace(line[part_len]))
+ part_len++;
+
+ /* no whitespace sep => print reminder as FRAGINFO */
+ if (!part_len)
+ return emit_line(ecbdata->file, frag, reset, line, len);
+
+ /* print whitespace sep as PLAIN */
+ emit_line(ecbdata->file, plain, reset, part_end, part_len);
+
+ /* consume whitespace sep */
+ len -= part_len;
+ line += part_len;
+
+ /* print reminder as FUNCINFO */
+ if (len)
+ emit_line(ecbdata->file, func, reset, line, len);
+}
+
static struct diff_tempfile *claim_diff_tempfile(void) {
int i;
for (i = 0; i < ARRAY_SIZE(diff_temp); i++)
@@ -781,9 +839,7 @@ static void fn_out_consume(void *priv, char *line, unsigned long len)
diff_words_flush(ecbdata);
len = sane_truncate_line(ecbdata, line, len);
find_lno(line, ecbdata);
- emit_line(ecbdata->file,
- diff_get_color(ecbdata->color_diff, DIFF_FRAGINFO),
- reset, line, len);
+ emit_hunk_line(ecbdata, line, len);
if (line[len-1] != '\n')
putc('\n', ecbdata->file);
return;
diff --git a/diff.h b/diff.h
index 2740421..15fcecd 100644
--- a/diff.h
+++ b/diff.h
@@ -130,6 +130,7 @@ enum color_diff {
DIFF_FILE_NEW = 5,
DIFF_COMMIT = 6,
DIFF_WHITESPACE = 7,
+ DIFF_FUNCINFO = 8,
};
const char *diff_get_color(int diff_use_color, enum color_diff ix);
#define diff_get_color_opt(o, ix) \
--
tg: (785c58e..) bw/func-color (depends on: master)
^ permalink raw reply related
* th/remote-usage
From: Jonathan Nieder @ 2009-11-18 11:48 UTC (permalink / raw)
To: Tim Henigan; +Cc: Junio C Hamano, git
In-Reply-To: <7v7hto46ce.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> [New Topics]
>
> * th/remote-usage (2009-11-16) 1 commit.
> - git remote: Separate usage strings for subcommands
Glancing at pu^2, I had two small nitpicks: [<options>...] is five
characters longer than strictly necessary, and the argument to git
remote set-head is not actually optional.
In other words, would it make sense to squash in something like the
following?
-- %< --
Subject: Tweak 'git remote' usage strings
The set-head argument is not optional. <options>... is five
characters wider than it needs to be.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
builtin-remote.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/builtin-remote.c b/builtin-remote.c
index ee86810..cfd8a36 100644
--- a/builtin-remote.c
+++ b/builtin-remote.c
@@ -7,14 +7,14 @@
#include "run-command.h"
#include "refs.h"
-#define REMOTE_BARE_USAGE "git remote [<options>...]"
-#define REMOTE_ADD_USAGE "git remote add [<options>...] <name> <url>"
+#define REMOTE_BARE_USAGE "git remote [options]"
+#define REMOTE_ADD_USAGE "git remote add [options] <name> <url>"
#define REMOTE_RENAME_USAGE "git remote rename <old> <new>"
#define REMOTE_RM_USAGE "git remote rm <name>"
-#define REMOTE_SETHEAD_USAGE "git remote set-head <name> [<options>...]"
-#define REMOTE_SHOW_USAGE "git remote show [<options>...] <name>"
-#define REMOTE_PRUNE_USAGE "git remote prune [<options>...] <name>"
-#define REMOTE_UPDATE_USAGE "git remote update [<options>...]"
+#define REMOTE_SETHEAD_USAGE "git remote set-head <name> (-a|-d|<branch>)"
+#define REMOTE_SHOW_USAGE "git remote show [options] <name>"
+#define REMOTE_PRUNE_USAGE "git remote prune [options] <name>"
+#define REMOTE_UPDATE_USAGE "git remote update [options]"
static const char * const builtin_remote_usage[] = {
REMOTE_BARE_USAGE,
--
1.6.5.2
^ permalink raw reply related
* Re: [PATCH] Give the hunk comment its own color
From: Tay Ray Chuan @ 2009-11-18 11:44 UTC (permalink / raw)
To: Bert Wesarg; +Cc: Junio C Hamano, git
In-Reply-To: <1258543836-799-1-git-send-email-bert.wesarg@googlemail.com>
Hi,
On Wed, Nov 18, 2009 at 7:30 PM, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> Insired by the coloring of quilt.
s/Insired/Inspired/?
--
Cheers,
Ray Chuan
^ permalink raw reply
* Re: th/remote-usage
From: Jonathan Nieder @ 2009-11-18 12:05 UTC (permalink / raw)
To: Tim Henigan; +Cc: Junio C Hamano, git
In-Reply-To: <20091118114808.GA13346@progeny.tock>
Hi,
Another thought.
Yesterday, Tim Henigan wrote:
> Do you object to the new #defines for the strings? I added them since we now
> really need to construct the usage string for 2 separate uses:
> (1) When 'git remote -h' is invoked, we need to return the usage
> string showing
> all subcommands.
> (2) When 'git remote <subcommand> -h' is invoked, we need to return the
> usage for just that command.
>
> It doesn't make sense to me to maintain separate strings for the two use cases.
Another option would be to make the strings into static variables.
I vaguely hoped this would help the code size a little, but gcc is
already smart enough to notice the strings are the same on its own.
Actually, this increases the text size by 15 bytes. Apparently,
static arrays have to live at 4-byte aligned addresses in the x86 ABI.
So there is not much to recommend this. I am sending it mostly for
academic interest. It also has the virtue of decreasing the density
of capital letters in the code.
builtin-remote.c | 47 ++++++++++++++++++++++++-----------------------
1 files changed, 24 insertions(+), 23 deletions(-)
diff --git a/builtin-remote.c b/builtin-remote.c
index cfd8a36..185ce42 100644
--- a/builtin-remote.c
+++ b/builtin-remote.c
@@ -7,34 +7,35 @@
#include "run-command.h"
#include "refs.h"
-#define REMOTE_BARE_USAGE "git remote [options]"
-#define REMOTE_ADD_USAGE "git remote add [options] <name> <url>"
-#define REMOTE_RENAME_USAGE "git remote rename <old> <new>"
-#define REMOTE_RM_USAGE "git remote rm <name>"
-#define REMOTE_SETHEAD_USAGE "git remote set-head <name> (-a|-d|<branch>)"
-#define REMOTE_SHOW_USAGE "git remote show [options] <name>"
-#define REMOTE_PRUNE_USAGE "git remote prune [options] <name>"
-#define REMOTE_UPDATE_USAGE "git remote update [options]"
+static const char remote_bare_usage[] = "git remote [options]";
+static const char remote_add_usage[] = "git remote add [options] <name> <url>";
+static const char remote_rename_usage[] = "git remote rename <old> <new>";
+static const char remote_rm_usage[] = "git remote rm <name>";
+static const char remote_sethead_usage[] =
+"git remote set-head <name> (-a|-d|<branch>)";
+static const char remote_show_usage[] = "git remote show [options] <name>";
+static const char remote_prune_usage[] = "git remote prune [options] <name>";
+static const char remote_update_usage[] = "git remote update [options]";
static const char * const builtin_remote_usage[] = {
- REMOTE_BARE_USAGE,
- REMOTE_ADD_USAGE,
- REMOTE_RENAME_USAGE,
- REMOTE_RM_USAGE,
- REMOTE_SETHEAD_USAGE,
- REMOTE_SHOW_USAGE,
- REMOTE_PRUNE_USAGE,
- REMOTE_UPDATE_USAGE,
+ remote_bare_usage,
+ remote_add_usage,
+ remote_rename_usage,
+ remote_rm_usage,
+ remote_sethead_usage,
+ remote_show_usage,
+ remote_prune_usage,
+ remote_update_usage,
NULL
};
-static const char * const builtin_remote_add_usage[] = { REMOTE_ADD_USAGE, NULL };
-static const char * const builtin_remote_rename_usage[] = { REMOTE_RENAME_USAGE, NULL };
-static const char * const builtin_remote_rm_usage[] = { REMOTE_RM_USAGE, NULL };
-static const char * const builtin_remote_sethead_usage[] = { REMOTE_SETHEAD_USAGE, NULL };
-static const char * const builtin_remote_show_usage[] = { REMOTE_SHOW_USAGE, NULL };
-static const char * const builtin_remote_prune_usage[] = { REMOTE_PRUNE_USAGE, NULL };
-static const char * const builtin_remote_update_usage[] = { REMOTE_UPDATE_USAGE, NULL };
+static const char * const builtin_remote_add_usage[] = { remote_add_usage, NULL };
+static const char * const builtin_remote_rename_usage[] = { remote_rename_usage, NULL };
+static const char * const builtin_remote_rm_usage[] = { remote_rm_usage, NULL };
+static const char * const builtin_remote_sethead_usage[] = { remote_sethead_usage, NULL };
+static const char * const builtin_remote_show_usage[] = { remote_show_usage, NULL };
+static const char * const builtin_remote_prune_usage[] = { remote_prune_usage, NULL };
+static const char * const builtin_remote_update_usage[] = { remote_update_usage, NULL };
#define GET_REF_STATES (1<<0)
#define GET_HEAD_NAMES (1<<1)
--
1.6.5.2
^ permalink raw reply related
* Re: [PATCH] Give the hunk comment its own color
From: Bert Wesarg @ 2009-11-18 11:57 UTC (permalink / raw)
To: Tay Ray Chuan; +Cc: Junio C Hamano, git
In-Reply-To: <be6fef0d0911180344ld31237et533cfa8832ea0c6c@mail.gmail.com>
On Wed, Nov 18, 2009 at 12:44, Tay Ray Chuan <rctay89@gmail.com> wrote:
> Hi,
>
> On Wed, Nov 18, 2009 at 7:30 PM, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
>> Insired by the coloring of quilt.
>
> s/Insired/Inspired/?
Sure.
I also forgot to update the test suit.
New patch follows.
Bert
>
> --
> Cheers,
> Ray Chuan
>
^ permalink raw reply
* Re: [ANNOUNCE] codeBeamer MR - Easy ACL for Git
From: Petr Baudis @ 2009-11-18 12:09 UTC (permalink / raw)
To: Intland Software; +Cc: git
In-Reply-To: <4B03B153.1020302@intland.com>
On Wed, Nov 18, 2009 at 09:33:23AM +0100, Intland Software wrote:
> codeBeamer MR is a new tool for teams working with Git, and striving for
> fast repository management and easy access control management.
> Setting up and maintaining ACL on top of Git is not trivial. With this
> web based tool, you can *save a lot of boring and error-prone maintainenace
> work*, and spend your time rather with coding.
>
> FEATURES
> * Starts and close projects and repositories in just seconds
> * Project-, group-, and role-based administration across multiple repositories
> * ACL on directory level
> * SSH authentication
> * Lightweight wiki, issue tracking and project management facilities
> * Web based
> * Remote API
>
> PRICE?
> It is *free* (as in beer). No expiration.
>
> LEARN MORE & DOWNLOAD
> More details, screenshots and downloads:
> http://www.intland.com/products/cb-mr/overview.html
Interesting, thank you for the announcement; it would be good to note
that it's not open-source.
I think a lot of people wonder now, how does this compare to existing
solutions; from your announcement I thought it's something like
Gitosis/Gitolite, but in fact it seems more similar to Gitorious or
GitHub (if it was publicly available, of course); perhaps it would be
good idea to present comparison to these on the project homepage.
--
Petr "Pasky" Baudis
A lot of people have my books on their bookshelves.
That's the problem, they need to read them. -- Don Knuth
^ permalink raw reply
* [PATCH] Makefile: add uninstall target. Fixes elementary good cleaning manners.
From: Jan Nieuwenhuizen @ 2009-11-18 12:29 UTC (permalink / raw)
To: Tomas Carnecky; +Cc: git
In-Reply-To: <48B54636-1825-48B3-BECD-4150A55B013F@dbservice.com>
Op woensdag 11-11-2009 om 15:08 uur [tijdzone +0100], schreef Tomas
Carnecky:
> > Greetings,
> > Jan. -- who just finds out the uninstall target is missing?!?
> > See attached.
>
> Next time please send patches inline, it's easier to review them that
> way.
Sorry. Let me retry that. See below.
Greetings,
Jan.
--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond - The music typesetter
Avatar®: http://AvatarAcademy.nl | http://lilypond.org
>From f260a4dcf0b42088eb1da74aee49f49ac4b0c55b Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Wed, 11 Nov 2009 14:19:00 +0100
Subject: [PATCH] Makefile: add uninstall target. Fixes elementary good cleaning manners.
* Modified Makefile
* Modified gitk-git/Makefile
* Modified perl/Makefile
* Modified templates/Makefile
Signed-off-by: Jan Nieuwenhuizen <janneke@gnu.org>
---
Makefile | 18 +++++++++++++++++-
gitk-git/Makefile | 2 ++
perl/Makefile | 2 +-
templates/Makefile | 5 +++++
4 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 5d5976f..135c3ac 100644
--- a/Makefile
+++ b/Makefile
@@ -1781,7 +1781,23 @@ quick-install-man:
quick-install-html:
$(MAKE) -C Documentation quick-install-html
+bindir_PROGRAMS = git$X git-upload-pack$X git-receive-pack$X git-upload-archive$X git-shell$X git-cvsserver
+uninstall:
+ifndef NO_TCLTK
+ $(MAKE) -C gitk-git uninstall
+ $(MAKE) -C git-gui gitexecdir='$(gitexec_instdir_SQ)' uninstall
+endif
+ifndef NO_PERL
+ $(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' uninstall
+endif
+ $(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' uninstall
+ $(RM) $(ALL_PROGRAMS:%='$(DESTDIR_SQ)$(gitexec_instdir_SQ)'/%)
+ $(RM) $(BUILT_INS:%='$(DESTDIR_SQ)$(gitexec_instdir_SQ)'/%)
+ $(RM) $(OTHER_PROGRAMS:%='$(DESTDIR_SQ)$(gitexec_instdir_SQ)'/%)
+ -rmdir -p '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
+ $(RM) $(bindir_PROGRAMS:%='$(DESTDIR_SQ)$(bindir_SQ)'/%)
+ -rmdir -p '$(DESTDIR_SQ)$(bindir_SQ)'
### Maintainer's dist rules
@@ -1857,7 +1873,7 @@ ifndef NO_TCLTK
endif
$(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-GUI-VARS GIT-BUILD-OPTIONS
-.PHONY: all install clean strip
+.PHONY: all install uninstall clean strip
.PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell
.PHONY: .FORCE-GIT-VERSION-FILE TAGS tags cscope .FORCE-GIT-CFLAGS
.PHONY: .FORCE-GIT-BUILD-OPTIONS
diff --git a/gitk-git/Makefile b/gitk-git/Makefile
index e1b6045..d68f19a 100644
--- a/gitk-git/Makefile
+++ b/gitk-git/Makefile
@@ -47,6 +47,8 @@ install:: all
uninstall::
$(foreach p,$(ALL_MSGFILES), $(RM) '$(DESTDIR_SQ)$(msgsdir_SQ)'/$(notdir $p) &&) true
$(RM) '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
+ -rmdir -p '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
+ -rmdir -p '$(DESTDIR_SQ)$(msgsdir_SQ)'
clean::
$(RM) gitk-wish po/*.msg
diff --git a/perl/Makefile b/perl/Makefile
index 4ab21d6..25fc304 100644
--- a/perl/Makefile
+++ b/perl/Makefile
@@ -10,7 +10,7 @@ ifndef V
QUIET = @
endif
-all install instlibdir: $(makfile)
+all install instlibdir uninstall: $(makfile)
$(QUIET)$(MAKE) -f $(makfile) $@
clean:
diff --git a/templates/Makefile b/templates/Makefile
index 408f013..f4048d9 100644
--- a/templates/Makefile
+++ b/templates/Makefile
@@ -51,3 +51,8 @@ install: all
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)'
(cd blt && $(TAR) cf - .) | \
(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xof -)
+
+uninstall:
+ -(cd blt && find . -type f) | (cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && xargs $(RM))
+ -(cd blt && find . -mindepth 1 -type d) | (cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && xargs rmdir)
+ -rmdir -p '$(DESTDIR_SQ)$(template_instdir_SQ)'
--
1.6.3.3
^ permalink raw reply related
* Hey - A Conceptual Simplication....
From: George Dennie @ 2009-11-18 12:55 UTC (permalink / raw)
To: git; +Cc: torvalds
A Clean checkout command might be...
The Git model does not seem to go far enough conceptually, for some
unexplainable reason...
In particular, why is Git not treating the entire working tree as the
versioned document (qualified of course by the .gitignore file).
Instead, Git is treating a manually maintained list of files within the
working tree as the versioned document, this list being initialized and
manually amended by the "Git add/rm/mv" commands, etc.
The result is conceptual complexity and rather counter-intuitive behavior.
For example, adding and renaming files outside of Git is not considered
editing the version until you subsequently do a "Git Add ." Contrast that
with editing or deleting files outside of Git. Yet adding and renaming files
and folders is a significant part of substantive projects, especially in the
early stages and experimental branches.
Granted, this is not a big deal functionally, but what is being lost is
conceptual simplicity (and consistency, in my book) and conceptual
simplicity is a key value point, if not THE key.
Also can we augment checkout to totally CLEAN the working directory prior to
a restore. If necessary we can augment .gitignore to stipulate those files
or folders that should be excluded from the cleaning. This suggestion is in
recognition of the fact that if you are not versioning the file, it is
typically trash; which becomes the case when the entire working treat is
treated as the versioned document.
Consequently, I recommend the following new commands:
"Git commit -x" -- performs a "Git add ." then a "Git commit"
"Git checkout -x" -- that clean the working tree prior to perform a
checkout
P.S.
Great your work.
George Dennie, BMath
The Point Of Sale People
www.pospeople.com
BUS: 416-496-2921
FAX: 416-496-9496
^ permalink raw reply
* Re: Hey - A Conceptual Simplication....
From: Jan Krüger @ 2009-11-18 13:25 UTC (permalink / raw)
To: George Dennie; +Cc: git, torvalds
In-Reply-To: <005a01ca684e$71a1d710$54e58530$@com>
Hi,
> The result is conceptual complexity and rather counter-intuitive
> behavior. For example, adding and renaming files outside of Git is
> not considered editing the version until you subsequently do a "Git
> Add ." Contrast that with editing or deleting files outside of Git.
> Yet adding and renaming files and folders is a significant part of
> substantive projects, especially in the early stages and experimental
> branches.
yet even now, people routinely add huge amounts of files they didn't
actually want to add, and then have to expend a huge amount of effort
to get them out of the history again (particularly if that history has
already been published).
What you are describing is a workflow that is even fuller of potential
for wrong turns than the current standard workflow is. If simplicity
leads to a greater potential for errors, how is it a good thing?
This kind of workflow actually involves more work for the user. She now
has to meticulously maintain an accurate list of ignore patterns,
particularly because of this:
> Also can we augment checkout to totally CLEAN the working directory
> prior to a restore. If necessary we can augment .gitignore to
> stipulate those files or folders that should be excluded from the
> cleaning.
So if I forget to add a certain pattern, my file is lost forever? Uhh...
> This suggestion is in recognition of the fact that if you
> are not versioning the file, it is typically trash
Just how typical is that, though? I wouldn't want to be the one to
judge that.
In light of my concerns, I oppose adding your suggestions to the
official CLI of git and I suggest that you create your own commands to
enable this kind of workflow. For example:
git config --global alias.commitx '!git add . && git commit'
git config --global alias.checkoutx '!git clean && git checkout'
Jan
^ permalink raw reply
* Re: [PATCH] Makefile: add uninstall target. Fixes elementary good cleaning manners.
From: Matthieu Moy @ 2009-11-18 13:28 UTC (permalink / raw)
To: Jan Nieuwenhuizen; +Cc: Tomas Carnecky, git
In-Reply-To: <1258547389.25909.101.camel@heerbeest>
Jan Nieuwenhuizen <janneke-list@xs4all.nl> writes:
> Sorry. Let me retry that. See below.
Please, read Documentation/SubmittingPatches
>>From f260a4dcf0b42088eb1da74aee49f49ac4b0c55b Mon Sep 17 00:00:00 2001
> From: Jan Nieuwenhuizen <janneke@gnu.org>
> Date: Wed, 11 Nov 2009 14:19:00 +0100
> Subject: [PATCH] Makefile: add uninstall target. Fixes elementary good cleaning manners.
>
> * Modified Makefile
> * Modified gitk-git/Makefile
> * Modified perl/Makefile
> * Modified templates/Makefile
Git knows better than you which files are modified by a commit, so
it's counter-productive to rewrite by hand this list in the commit
message. This place is the place to explain _why_ your change is good
(to convince the maintainer to apply it in git.git in particular).
> Makefile | 18 +++++++++++++++++-
> gitk-git/Makefile | 2 ++
> perl/Makefile | 2 +-
> templates/Makefile | 5 +++++
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ 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