* Re: [PATCH v2] git-help: add "help.format" config variable.
From: Junio C Hamano @ 2007-12-15 5:20 UTC (permalink / raw)
To: Christian Couder; +Cc: git
In-Reply-To: <20071215055728.857b1924.chriscool@tuxfamily.org>
Christian Couder <chriscool@tuxfamily.org> writes:
> Note that this patch also revert some recent changes in
> "git-browse-help" because they prevented to look for config
> variables in the global configuration file.
You are right, but I think git-sh-setup can further be simplified, as
NONGIT_OK users would just rely on the default behaviour of underlying
plumbing (most notably "git config").
I do not think your change to help.c is sufficient to work inside a
subdirectory. Here is an attempt to fix it on top of yours.
---
git-sh-setup.sh | 7 +------
help.c | 3 +++
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/git-sh-setup.sh b/git-sh-setup.sh
index b366761..270d559 100755
--- a/git-sh-setup.sh
+++ b/git-sh-setup.sh
@@ -124,13 +124,8 @@ get_author_ident_from_commit () {
# Make sure we are in a valid repository of a vintage we understand,
# if we require to be in a git repository.
-if test -n "$NONGIT_OK"
+if test -z "$NONGIT_OK"
then
- if git rev-parse --git-dir >/dev/null 2>&1
- then
- : ${GIT_DIR=.git}
- fi
-else
if [ -z "$SUBDIRECTORY_OK" ]
then
: ${GIT_DIR=.git}
diff --git a/help.c b/help.c
index af0a433..551b5b9 100644
--- a/help.c
+++ b/help.c
@@ -374,6 +374,9 @@ int cmd_help(int argc, const char **argv, const char *prefix)
}
else {
+ int nongit;
+
+ setup_git_directory_gently(&nongit);
git_config(git_help_config);
if (help_default_format)
parse_help_format(help_default_format);
^ permalink raw reply related
* Re: [PATCH] Replace the cryptic messages from "git stash show".
From: Junio C Hamano @ 2007-12-15 6:12 UTC (permalink / raw)
To: Jing Xue; +Cc: git
In-Reply-To: <20071215051425.GA9118@fawkes>
Jing Xue <jingxue@digizenstudio.com> writes:
> On Thu, Dec 13, 2007 at 05:34:40PM -0800, Junio C Hamano wrote:
>>
>> I agree "git stash show" should not give cryptic error message, but I
>> think you should do this only when the user did not explicitly say which
>> stash to show (that is, we should still give error message if the user
>> said "git stash show garbage").
>
> Good point. Actually I found out that if there _are_ some stashes and an
> invalid name is given, the current behavior is still printing
> refs/stash, which I think is not quite right. So I also try to fix that
> while I'm at it.
>
> Now "git stash show" will keep quiet and just exit if there are no
> stashes at all. "git stash show some-non-existent-stash" will always
> print a clear message indicating the case.
>
> ---
> git-stash.sh | 23 ++++++++++++++++++++---
> 1 files changed, 20 insertions(+), 3 deletions(-)
>
> diff --git a/git-stash.sh b/git-stash.sh
> index f16fd9c..40e93dd 100755
> --- a/git-stash.sh
> +++ b/git-stash.sh
> @@ -116,13 +116,30 @@ show_stash () {
> flags=$(git rev-parse --no-revs --flags "$@")
> if test -z "$flags"
> then
> - flags=--stat
> + diff_flags=--stat
> + else
> + diff_flags=$flags
> + fi
> + s=$(git rev-parse --revs-only --no-flags "$@")
> + if test -z "$s"
> + then
> + arguments=$@
> + if test "${flags}" = "${arguments}"
> + then
> + s=$(git rev-parse --revs-only --no-flags $ref_stash)
> + if test -z "$s"
> + then
> + return 0
> + fi
> + else
> + eval stash_name=\$$#
> + die "Can't find any stash with name $stash_name"
> + fi
> fi
Is it just me who feels that the added code is much worse than the
disease?
^ permalink raw reply
* [PATCH] Retire git-runstatus for real.
From: Junio C Hamano @ 2007-12-15 6:21 UTC (permalink / raw)
To: git
The command was removed from the builtin command list and there was no
way to invoke it, but the code was still there.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
Documentation/git-runstatus.txt | 68 ---------------------------------------
Makefile | 2 +-
builtin-runstatus.c | 38 ---------------------
command-list.txt | 1 -
4 files changed, 1 insertions(+), 108 deletions(-)
delete mode 100644 Documentation/git-runstatus.txt
delete mode 100644 builtin-runstatus.c
diff --git a/Documentation/git-runstatus.txt b/Documentation/git-runstatus.txt
deleted file mode 100644
index dee5d0d..0000000
--- a/Documentation/git-runstatus.txt
+++ /dev/null
@@ -1,68 +0,0 @@
-git-runstatus(1)
-================
-
-NAME
-----
-git-runstatus - A helper for git-status and git-commit
-
-
-SYNOPSIS
---------
-'git-runstatus' [--color|--nocolor] [--amend] [--verbose] [--untracked]
-
-
-DESCRIPTION
------------
-Examines paths in the working tree that has changes unrecorded
-to the index file, and changes between the index file and the
-current HEAD commit. The former paths are what you _could_
-commit by running 'git add' (or 'git rm' if you are deleting) before running 'git
-commit', and the latter paths are what you _would_ commit by
-running 'git commit'.
-
-If there is no path that is different between the index file and
-the current HEAD commit, the command exits with non-zero status.
-
-Note that this is _not_ the user level command you would want to
-run from the command line. Use 'git-status' instead.
-
-
-OPTIONS
--------
---color::
- Show colored status, highlighting modified file names.
-
---nocolor::
- Turn off coloring.
-
---amend::
- Show status based on HEAD^1, not HEAD, i.e. show what
- 'git-commit --amend' would do.
-
---verbose::
- Show unified diff of all file changes.
-
---untracked::
- Show files in untracked directories, too. Without this
- option only its name and a trailing slash are displayed
- for each untracked directory.
-
-
-OUTPUT
-------
-The output from this command is designed to be used as a commit
-template comments, and all the output lines are prefixed with '#'.
-
-
-Author
-------
-Originally written by Linus Torvalds <torvalds@osdl.org> as part
-of git-commit, and later rewritten in C by Jeff King.
-
-Documentation
---------------
-Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
-
-GIT
----
-Part of the gitlink:git[7] suite
diff --git a/Makefile b/Makefile
index 43d6197..b9fe40b 100644
--- a/Makefile
+++ b/Makefile
@@ -933,7 +933,7 @@ git-http-push$X: revision.o http.o http-push.o $(GITLIBS)
$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
$(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
-builtin-revert.o builtin-runstatus.o wt-status.o: wt-status.h
+builtin-revert.o wt-status.o: wt-status.h
$(LIB_FILE): $(LIB_OBJS)
$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS)
diff --git a/builtin-runstatus.c b/builtin-runstatus.c
deleted file mode 100644
index 8d167a9..0000000
--- a/builtin-runstatus.c
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "builtin.h"
-#include "cache.h"
-#include "wt-status.h"
-
-extern int wt_status_use_color;
-
-static const char runstatus_usage[] =
-"git-runstatus [--color|--nocolor] [--amend] [--verbose] [--untracked]";
-
-int cmd_runstatus(int argc, const char **argv, const char *prefix)
-{
- struct wt_status s;
- int i;
-
- git_config(git_status_config);
- wt_status_prepare(&s);
- s.prefix = prefix;
-
- for (i = 1; i < argc; i++) {
- if (!strcmp(argv[i], "--color"))
- wt_status_use_color = 1;
- else if (!strcmp(argv[i], "--nocolor"))
- wt_status_use_color = 0;
- else if (!strcmp(argv[i], "--amend")) {
- s.amend = 1;
- s.reference = "HEAD^1";
- }
- else if (!strcmp(argv[i], "--verbose"))
- s.verbose = 1;
- else if (!strcmp(argv[i], "--untracked"))
- s.untracked = 1;
- else
- usage(runstatus_usage);
- }
-
- wt_status_print(&s);
- return s.commitable ? 0 : 1;
-}
diff --git a/command-list.txt b/command-list.txt
index 28342da..6c2b1d8 100644
--- a/command-list.txt
+++ b/command-list.txt
@@ -98,7 +98,6 @@ git-revert mainporcelain
git-rev-list plumbinginterrogators
git-rev-parse ancillaryinterrogators
git-rm mainporcelain common
-git-runstatus ancillaryinterrogators
git-send-email foreignscminterface
git-send-pack synchingrepositories
git-shell synchelpers
--
1.5.4.rc0.1096.gcd2a6
^ permalink raw reply related
* Re: relative objects/info/alternates
From: Luciano Rocha @ 2007-12-15 7:39 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <m3bq8tqs9c.fsf@roke.D-201>
[-- Attachment #1: Type: text/plain, Size: 1366 bytes --]
On Fri, Dec 14, 2007 at 06:13:09AM -0800, Jakub Narebski wrote:
> Luciano Rocha <luciano@eurotux.com> writes:
>
> > Can I use relative $GIT_DIR/objects/info/alternates? Will the git
> > commands work anywhere inside the working-copy despice the alternate
> > being relative to the root of it?
>
> From the information in repository layout documentation:
>
> objects/info/alternates::
> This file records paths to alternate object stores that
> this object store borrows objects from, one pathname per
> line. Note that not only native Git tools use it locally,
> but the HTTP fetcher also tries to use it remotely; this
> will usually work if you have relative paths (relative
> to the object database, not to the repository!) in your
> alternates file, but it will not work if you use absolute
> paths unless the absolute path in filesystem and web URL
> is the same. See also 'objects/info/http-alternates'.
>
> it looks like you can have relative paths in alternates.
It doesn't work too well, when a tree with relative alternat is used by
another:
error: ./objects/../../2.6.23.y.git/objects: ignoring relative
alternate object store ../../linus.git/objects
--
Luciano Rocha <luciano@eurotux.com>
Eurotux Informática, S.A. <http://www.eurotux.com/>
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: git-browse-help?
From: Jeff King @ 2007-12-15 10:08 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Christian Couder, git
In-Reply-To: <7vtzmlrxc2.fsf@gitster.siamese.dyndns.org>
On Fri, Dec 14, 2007 at 09:38:05AM -0800, Junio C Hamano wrote:
> > Should it perhaps be "git--browse-help" or "git-help--browse" to follow
> Good eyes and a sensible argument. Go wild.
Looks like you beat me to it. Thanks.
-Peff
^ permalink raw reply
* Re: git-cvsexportcommit fails for huge commits
From: Jeff King @ 2007-12-15 10:09 UTC (permalink / raw)
To: Robin Rosenberg; +Cc: Junio C Hamano, Markus Klinik, git
In-Reply-To: <200712141447.05039.robin.rosenberg.lists@dewire.com>
On Fri, Dec 14, 2007 at 02:47:03PM +0100, Robin Rosenberg wrote:
> > So here is a cleaned up patch. It bumps the maximum size to 64kB, adds
> > scalar support (nobody uses it, but it makes sense for the interface to
> > match that of safe_pipe_capture -- I am even tempted to just replace
> > safe_pipe_capture entirely and convert the few other callers), and
> > cleans up the unused safe_pipe_capture_blob.
>
> Wouldn't using the POSIX::ARG_MAX constant work?
It does seem to produce sensible results. Does it work reasonably on
Windows?
Note that it would also need to be ARG_MAX - slop, where slop accounts
for the environment (which maybe we can get accurately by counting the
keys and values of %ENV, adding NUL terminators?).
-Peff
^ permalink raw reply
* Re: git-browse-help?
From: Jeff King @ 2007-12-15 11:01 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Shawn O. Pearce, Christian Couder, git
In-Reply-To: <20071215100811.GA1692@coredump.intra.peff.net>
On Sat, Dec 15, 2007 at 05:08:11AM -0500, Jeff King wrote:
> On Fri, Dec 14, 2007 at 09:38:05AM -0800, Junio C Hamano wrote:
>
> > > Should it perhaps be "git--browse-help" or "git-help--browse" to follow
> > Good eyes and a sensible argument. Go wild.
>
> Looks like you beat me to it. Thanks.
Although I would have called it "git-help--browse" rather than
"git-browse--help" since
a) it is related to "git help", not "git browse"
b) there is no tab completion conflict with git-he, but there is with
git-br. :) This is of course because I am using the file
completion, but the programmable bash completion has the same
problem. Shawn, perhaps it should simply ignore *--* as plumbing?
I can prepare a patch if "git-help--browse" makes more sense.
-Peff
^ permalink raw reply
* Re: [RFH] convert shortlog to use parse_options
From: Pierre Habouzit @ 2007-12-15 11:03 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Jeff King, Kristian Høgsberg, git
In-Reply-To: <7v63z1qakt.fsf@gitster.siamese.dyndns.org>
[-- Attachment #1: Type: text/plain, Size: 1290 bytes --]
On ven, déc 14, 2007 at 08:34:58 +0000, Junio C Hamano wrote:
> Pierre Habouzit <madcoder@debian.org> writes:
>
> > On Fri, Dec 14, 2007 at 05:59:52AM +0000, Junio C Hamano wrote:
> >> git cmd --abbrev=10 -n=4
> >
> > actually -n=4 isn't understood atm, only -n4 and -n 4 are.
>
> Ah, my mistake. And I do not think accepting -n=4 is a good idea (it is
> not historically done).
> After thinking about it a bit more, I think I was worried too much about
> burdening the users to remember the differences between options with,
> without and optional option-arguments [*1*]. They need to know the
> difference between options with and without option-arguments already
> because single letter options can be combined if they are without
> option-arguments, and they have to write "shortlog -new72" but not
> "shortlog -wen72". If they want to be extra sure, they can be more
> explicit and say "shortlog -n -e -w72".
Yep, let's do it then. Note that's the reason why I felt we need a
manual page about this, because we should give some guidelines of what
is safe for scripting.
--
·O· Pierre Habouzit
··O madcoder@debian.org
OOO http://www.madism.org
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: git-browse-help?
From: Jeff King @ 2007-12-15 11:11 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Shawn O. Pearce, Christian Couder, git
In-Reply-To: <20071215110153.GA3447@coredump.intra.peff.net>
On Sat, Dec 15, 2007 at 06:01:53AM -0500, Jeff King wrote:
> problem. Shawn, perhaps it should simply ignore *--* as plumbing?
And here is a patch to do that.
-- >8 --
teach bash completion to treat commands with "--" as plumbing
There is a convention that commands containing a double-dash
are implementation details and not to be used by mortals. We
should automatically remove them from the completion
suggestions as plumbing.
Signed-off-by: Jeff King <peff@peff.net>
---
BTW, Junio, I remember discussion a long time ago about doing:
cover letter
-- >8 --
commit
---
diff
versus
commit
---
cover letter
diff
and I recall that you did not have a strong preference. I have started
using the former, as I find it a bit more convenient to write (and I
think it is more readable when you are following up a discussion rather
than writing a real cover letter or commenting on the patch). However,
I wanted to confirm that you don't find it significantly more annoying.
contrib/completion/git-completion.bash | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 58e0e53..2fd32db 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -291,7 +291,7 @@ __git_commands ()
for i in $(git help -a|egrep '^ ')
do
case $i in
- add--interactive) : plumbing;;
+ *--*) : plumbing pattern;;
applymbox) : ask gittus;;
applypatch) : ask gittus;;
archimport) : import;;
@@ -308,7 +308,6 @@ __git_commands ()
diff-tree) : plumbing;;
fast-import) : import;;
fsck-objects) : plumbing;;
- fetch--tool) : plumbing;;
fetch-pack) : plumbing;;
fmt-merge-msg) : plumbing;;
for-each-ref) : plumbing;;
--
1.5.4.rc0.1124.g1b66f-dirty
^ permalink raw reply related
* trim_common_tail bug?
From: Jeff King @ 2007-12-15 11:16 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Linus Torvalds, git
Something seems to be not quite right with the trim_common_tail code in
xdiff-interface.c. The diff I just sent for contrib/completion looks
fine (as I sent it) when I comment out trim_common_tail. But using
the current master, it looks like this:
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 58e0e53..2fd32db 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -291,7 +291,7 @@ __git_commands ()
for i in $(git help -a|egrep '^ ')
do
case $i in
- add--interactive) : plumbing;;
+ *--*) : plumbing pattern;;
applymbox) : ask gittus;;
applypatch) : ask gittus;;
archimport) : import;;
@@ -307,5 +307,4 @@ __git_commands ()
diff-index) : plumbing;;
diff-tree) : plumbing;;
fast-import) : import;;
- fsck-objects) : plumbing;;
- fetch--tool) : plumbing;;
\ No newline at end of file
+ fsck-objects) : plumbing;;
\ No newline at end of file
-Peff
^ permalink raw reply related
* [PATCH 0/3 (resend)] gitweb: Miscelanous fixes
From: Jakub Narebski @ 2007-12-15 14:34 UTC (permalink / raw)
To: git; +Cc: Junio Hamano
There were a few gitweb patches which were send (and seemed to
be accepted) before 1.5.4-rc0 (and before feature freeze request),
but are not in 'master'; it is not even in 'offcuts' (what is this
branch for by the way?).
All those patches are simple bugfixes (well, perhaps exept last one,
but even it can be treated as bugfix). All passes the gitweb test:
t9500-gitweb-standalone-no-errors (not that it says much).
Patches are independent conceptually, and should be textually
independent. Apply to 'master'
Table of contents:
[PATCH] gitweb: Make config_to_multi return [] instead of [undef]
[PATCH] gitweb: disambiguate heads and tags withs the same name
[PATCH] gitweb: Teach "a=blob" action to be more lenient about
blob/file mime type
Diffstat:
gitweb/gitweb.perl | 38 ++++++++++++++++---------------
t/t9500-gitweb-standalone-no-errors.sh | 25 +++++++++++++++++++++
2 files changed, 45 insertions(+), 18 deletions(-)
P.S. I could not check if gitweb shows correct output as my Apache
has very mysteriously stopped working and refused to restart. It might
have been cause by an incident when runaway program filled whole disk
space with log, leaving no space on device... but it might not.
# /etc/rc.d/init.d/httpd status
httpd is stopped
# /etc/rc.d/init.d/httpd configtest
Syntax OK
# /etc/rc.d/init.d/httpd start
Starting httpd: [FAILED]
# cat /var/log/httpd/error_log
Configuration Failed
$ rpm -q httpd
httpd-2.0.54-10.3
--
Jakub Narębski
Poland
^ permalink raw reply
* [PATCH] gitweb: Make config_to_multi return [] instead of [undef]
From: Jakub Narebski @ 2007-12-15 14:36 UTC (permalink / raw)
To: git; +Cc: Junio Hamano, Petr Baudis
In-Reply-To: <200712151534.50951.jnareb@gmail.com>
From: Petr Baudis <pasky@suse.cz>
Date: Sat, 8 Dec 2007 12:30:59 +0100
Subject: [PATCH] gitweb: Make config_to_multi return [] instead of [undef]
This is important for the list of clone urls, where if there are
no per-repository clone URL configured, the default base URLs
are never used for URL construction without this patch.
Add tests for different ways of setting project URLs, just in case.
Note that those tests in current form wouldn't detect breakage fixed
by this patch, as it only checks for errors and not for expected
output.
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Originally by Petr Baudis, changed to use defined($val). I have also
added parentheses for better readibility.
I have added tests _then_ I have realized that in current form they
cannot detect regression corrected by this patch. So if you want, you
can not apply changes to test (and remove paragraph about test from
commit message).
The fact that patch was not applied might be cause by the lack of Ack
from pasky.
gitweb/gitweb.perl | 2 +-
t/t9500-gitweb-standalone-no-errors.sh | 25 +++++++++++++++++++++++++
2 files changed, 26 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 24b3158..a746a85 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1511,7 +1511,7 @@ sub config_to_int {
sub config_to_multi {
my $val = shift;
- return ref($val) ? $val : [ $val ];
+ return ref($val) ? $val : (defined($val) ? [ $val ] : []);
}
sub git_get_project_config {
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index 35fff3d..2d3d4e8 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -558,6 +558,31 @@ test_expect_success \
test_debug 'cat gitweb.log'
# ----------------------------------------------------------------------
+# testing config_to_multi / cloneurl
+
+test_expect_success \
+ 'URL: no project URLs, no base URL' \
+ 'gitweb_run "p=.git;a=summary"'
+test_debug 'cat gitweb.log'
+
+test_expect_success \
+ 'URL: project URLs via gitweb.url' \
+ 'git config --add gitweb.url git://example.com/git/trash.git &&
+ git config --add gitweb.url http://example.com/git/trash.git &&
+ gitweb_run "p=.git;a=summary"'
+test_debug 'cat gitweb.log'
+
+cat >.git/cloneurl <<\EOF
+git://example.com/git/trash.git
+http://example.com/git/trash.git
+EOF
+
+test_expect_success \
+ 'URL: project URLs via cloneurl file' \
+ 'gitweb_run "p=.git;a=summary"'
+test_debug 'cat gitweb.log'
+
+# ----------------------------------------------------------------------
# gitweb config and repo config
cat >>gitweb_config.perl <<EOF
--
1.5.3.7
^ permalink raw reply related
* [PATCH] gitweb: disambiguate heads and tags withs the same name
From: Jakub Narebski @ 2007-12-15 14:40 UTC (permalink / raw)
To: git; +Cc: Junio Hamano, Guillaume Seguin
In-Reply-To: <200712151534.50951.jnareb@gmail.com>
Avoid wrong disambiguation that would link logs/trees of tags and
heads which share the same name to the same page, leading to
a disambiguation that would prefer the tag, thus making it impossible
to access the corresponding head log and tree without hacking the url
by hand.
It does it by using full refname (with 'refs/heads/' or 'refs/tags/'
prefix) instead of shortened one in the URLs in 'heads' and 'tags'
tables. This makes URLs (and refs) provided by gitweb unambiguous.
Signed-off-by: Guillaume Seguin <guillaume@segu.in>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Based on the patch by Guillaume Seguin, which solved the same problem
in slightly different way, by re-adding 'refs/heads/' or 'refs/tags/'.
I think this way is slightly better.
Note that there is companion RFC patch (which is not a part of this
mini-series) which added check if the refname is ambiguous in git_tag:
"gitweb: Try harder in parse_tag; perhaps it was given ambiguous name"
gitweb/gitweb.perl | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index a746a85..448dca7 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2233,6 +2233,7 @@ sub git_get_heads_list {
my ($hash, $name, $title) = split(' ', $refinfo, 3);
my ($committer, $epoch, $tz) =
($committerinfo =~ /^(.*) ([0-9]+) (.*)$/);
+ $ref_item{'fullname'} = $name;
$name =~ s!^refs/heads/!!;
$ref_item{'name'} = $name;
@@ -2270,6 +2271,7 @@ sub git_get_tags_list {
my ($id, $type, $name, $refid, $reftype, $title) = split(' ', $refinfo, 6);
my ($creator, $epoch, $tz) =
($creatorinfo =~ /^(.*) ([0-9]+) (.*)$/);
+ $ref_item{'fullname'} = $name;
$name =~ s!^refs/tags/!!;
$ref_item{'type'} = $type;
@@ -3690,8 +3692,8 @@ sub git_tags_body {
"<td class=\"link\">" . " | " .
$cgi->a({-href => href(action=>$tag{'reftype'}, hash=>$tag{'refid'})}, $tag{'reftype'});
if ($tag{'reftype'} eq "commit") {
- print " | " . $cgi->a({-href => href(action=>"shortlog", hash=>$tag{'name'})}, "shortlog") .
- " | " . $cgi->a({-href => href(action=>"log", hash=>$tag{'name'})}, "log");
+ print " | " . $cgi->a({-href => href(action=>"shortlog", hash=>$tag{'fullname'})}, "shortlog") .
+ " | " . $cgi->a({-href => href(action=>"log", hash=>$tag{'fullname'})}, "log");
} elsif ($tag{'reftype'} eq "blob") {
print " | " . $cgi->a({-href => href(action=>"blob_plain", hash=>$tag{'refid'})}, "raw");
}
@@ -3726,13 +3728,13 @@ sub git_heads_body {
$alternate ^= 1;
print "<td><i>$ref{'age'}</i></td>\n" .
($curr ? "<td class=\"current_head\">" : "<td>") .
- $cgi->a({-href => href(action=>"shortlog", hash=>$ref{'name'}),
+ $cgi->a({-href => href(action=>"shortlog", hash=>$ref{'fullname'}),
-class => "list name"},esc_html($ref{'name'})) .
"</td>\n" .
"<td class=\"link\">" .
- $cgi->a({-href => href(action=>"shortlog", hash=>$ref{'name'})}, "shortlog") . " | " .
- $cgi->a({-href => href(action=>"log", hash=>$ref{'name'})}, "log") . " | " .
- $cgi->a({-href => href(action=>"tree", hash=>$ref{'name'}, hash_base=>$ref{'name'})}, "tree") .
+ $cgi->a({-href => href(action=>"shortlog", hash=>$ref{'fullname'})}, "shortlog") . " | " .
+ $cgi->a({-href => href(action=>"log", hash=>$ref{'fullname'})}, "log") . " | " .
+ $cgi->a({-href => href(action=>"tree", hash=>$ref{'fullname'}, hash_base=>$ref{'name'})}, "tree") .
"</td>\n" .
"</tr>";
}
--
1.5.3.7
^ permalink raw reply related
* [PATCH] gitweb: Teach "a=blob" action to be more lenient about blob/file mime type
From: Jakub Narebski @ 2007-12-15 14:41 UTC (permalink / raw)
To: git; +Cc: Junio Hamano
In-Reply-To: <200712151534.50951.jnareb@gmail.com>
Since 930cf7dd7cc6b87d173f182230763e1f1913d319 'blob' action knows the
file type; if the file type is not "text/*" or one of common network
image formats/mimetypes (gif, png, jpeg) then the action "blob"
defaulted to "blob_plain". This caused the problem if mimetypes file
was not well suited for web, for example returning "application/x-sh"
for "*.sh" shell scripts, instead of "text/plain" (or other "text/*").
Now "blob" action defaults to "blob_plain" ('raw' view) only if file
is of type which is neither "text/*" nor "image/{gif,png,jpeg}"
AND it is binary file. Otherwise it assumes that it can be displayed
either in <img> tag ("image/*" mimetype), or can be displayed line by
line (otherwise).
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Original version of the patch has a simple bug.
gitweb/gitweb.perl | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 448dca7..6256641 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -4290,7 +4290,7 @@ sub git_blob {
open my $fd, "-|", git_cmd(), "cat-file", "blob", $hash
or die_error(undef, "Couldn't cat $file_name, $hash");
my $mimetype = blob_mimetype($fd, $file_name);
- if ($mimetype !~ m!^(?:text/|image/(?:gif|png|jpeg)$)!) {
+ if ($mimetype !~ m!^(?:text/|image/(?:gif|png|jpeg)$)! && -B $fd) {
close $fd;
return git_blob_plain($mimetype);
}
@@ -4331,16 +4331,7 @@ sub git_blob {
}
git_print_page_path($file_name, "blob", $hash_base);
print "<div class=\"page_body\">\n";
- if ($mimetype =~ m!^text/!) {
- my $nr;
- while (my $line = <$fd>) {
- chomp $line;
- $nr++;
- $line = untabify($line);
- printf "<div class=\"pre\"><a id=\"l%i\" href=\"#l%i\" class=\"linenr\">%4i</a> %s</div>\n",
- $nr, $nr, $nr, esc_html($line, -nbsp=>1);
- }
- } elsif ($mimetype =~ m!^image/!) {
+ if ($mimetype =~ m!^image/!) {
print qq!<img type="$mimetype"!;
if ($file_name) {
print qq! alt="$file_name" title="$file_name"!;
@@ -4349,6 +4340,15 @@ sub git_blob {
href(action=>"blob_plain", hash=>$hash,
hash_base=>$hash_base, file_name=>$file_name) .
qq!" />\n!;
+ } else {
+ my $nr;
+ while (my $line = <$fd>) {
+ chomp $line;
+ $nr++;
+ $line = untabify($line);
+ printf "<div class=\"pre\"><a id=\"l%i\" href=\"#l%i\" class=\"linenr\">%4i</a> %s</div>\n",
+ $nr, $nr, $nr, esc_html($line, -nbsp=>1);
+ }
}
close $fd
or print "Reading blob failed.\n";
--
1.5.3.7
^ permalink raw reply related
* Windows binaries for qgit 2.0
From: Marco Costalba @ 2007-12-15 15:02 UTC (permalink / raw)
To: Git Mailing List
Due to a feature request on sourceforge qgit account:
http://sourceforge.net/tracker/index.php?func=detail&aid=1759403&group_id=139897&atid=744830
I have cooked and uploaded a qgit.exe file with Qt4.3.3 statically
linked in so to let Windows users that just want to give a shot to
qgit the possibility to try it easily.
Normally I use debug shared Qt libraries for development, so after
some effort I finally managed to build the static ones and finally to
build qgit.exe
Problem is that _this_ qgit.exe shows strange misbehaviour like 20X
slower then the one I normally build for development, there is also
some strange artifacts with file history graph.
I have a clue that is due to static Qt + mingw 3.4 problems, I have
read something on it somewhere, but I would like to ask if someone has
experienced the same problems when running qgit2.0 under Windows.
BTW if someone is interested, in the sourceforge thread above there is
the link to download this zipped file, testing is very easy and quick,
just extract files where git.exe is and start qgit.exe...
Thanks for any help
Marco
^ permalink raw reply
* Re: [PATCH] gitweb: Make config_to_multi return [] instead of [undef]
From: Petr Baudis @ 2007-12-15 15:05 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git, Junio Hamano
In-Reply-To: <200712151536.33296.jnareb@gmail.com>
On Sat, Dec 15, 2007 at 03:36:32PM +0100, Jakub Narebski wrote:
> From: Petr Baudis <pasky@suse.cz>
> Date: Sat, 8 Dec 2007 12:30:59 +0100
> Subject: [PATCH] gitweb: Make config_to_multi return [] instead of [undef]
>
> This is important for the list of clone urls, where if there are
> no per-repository clone URL configured, the default base URLs
> are never used for URL construction without this patch.
>
> Add tests for different ways of setting project URLs, just in case.
> Note that those tests in current form wouldn't detect breakage fixed
> by this patch, as it only checks for errors and not for expected
> output.
>
> Signed-off-by: Petr Baudis <pasky@suse.cz>
> Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Thank you all for catching the defined($val). :-)
--
Petr "Pasky" Baudis
We don't know who it was that discovered water, but we're pretty sure
that it wasn't a fish. -- Marshall McLuhan
^ permalink raw reply
* Re: trim_common_tail bug?
From: Jeff King @ 2007-12-15 15:51 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Linus Torvalds, git
In-Reply-To: <20071215111621.GA8139@coredump.intra.peff.net>
On Sat, Dec 15, 2007 at 06:16:21AM -0500, Jeff King wrote:
> Something seems to be not quite right with the trim_common_tail code in
> xdiff-interface.c. The diff I just sent for contrib/completion looks
> fine (as I sent it) when I comment out trim_common_tail. But using
> the current master, it looks like this:
Hrm. It feels like there is an off-by-one when recovering the context
lines; we end the inner loop at the newline, but then we never skip past
it. So we end up counting only one line total, and even that ends up
with a missing newline. Something like this fixes it for me, but
somebody please double check.
diff --git a/xdiff-interface.c b/xdiff-interface.c
index 700def2..eb60e88 100644
--- a/xdiff-interface.c
+++ b/xdiff-interface.c
@@ -124,6 +124,8 @@ static void trim_common_tail(mmfile_t *a, mmfile_t *b, long ctx)
for (i = 0, recovered = 0; recovered < trimmed && i <= ctx; i++) {
while (recovered < trimmed && ap[recovered] != '\n')
recovered++;
+ if (recovered < trimmed && ap[recovered] == '\n')
+ recovered++;
}
a->size -= (trimmed - recovered);
b->size -= (trimmed - recovered);
^ permalink raw reply related
* Re: [PATCH] git-svn: handle our top-level path is deleted and later re-added
From: Peter Baumann @ 2007-12-15 16:35 UTC (permalink / raw)
To: Eric Wong; +Cc: Junio C Hamano, Marcus D. Hanwell, git
In-Reply-To: <20071214163909.GA18300@soma>
On Fri, Dec 14, 2007 at 08:39:09AM -0800, Eric Wong wrote:
> Previously, git-svn would ignore cases where the path we're
> tracking is removed from the repository. This was to prevent
> heads with follow-parent from ending up with a tree full of
> empty revisions (and thus breaking rename detection).
>
> The previous behavior is fine until the path we're tracking
> is re-added later on, leading to the old files being merged
> in with the new files in the directory (because the old
> files were never marked as deleted)
>
> We will now only remove all the old files locally that were
> deleted remotely iff we detect the directory we're in is being
> created from scratch.
>
> Thanks for Marcus D. Hanwell for the bug report and
> Peter Baumann for the analysis.
>
> Signed-off-by: Eric Wong <normalperson@yhbt.net>
[...]
It seems to solve the problem seen in the avogadro repo. At least
the suspicious revisions I checked looked identical in the imported
version.
-Peter
^ permalink raw reply
* [RFC 2/4] gitk: Add diff-diff support
From: Steffen Prohaska @ 2007-12-15 16:51 UTC (permalink / raw)
To: git; +Cc: Steffen Prohaska
In-Reply-To: <1197737505128-git-send-email-prohaska@zib.de>
---
gitk-git/gitk | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 1da0b0a..ca121e4 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -1019,6 +1019,8 @@ proc makewindow {} {
-command {diffvssel 0}
$rowctxmenu add command -label "Diff selected -> this" \
-command {diffvssel 1}
+ $rowctxmenu add command -label "Diff Diff selected -> this" \
+ -command {diffdiffvssel 1}
$rowctxmenu add command -label "Make patch" -command mkpatch
$rowctxmenu add command -label "Create tag" -command mktag
$rowctxmenu add command -label "Write commit to file" -command writecommit
@@ -6010,6 +6012,50 @@ proc doseldiff {oldid newid} {
startdiff [list $oldid $newid]
}
+proc diffdiffvssel {dirn} {
+ global rowmenuid selectedline displayorder
+
+ if {![info exists selectedline]} return
+ if {$dirn} {
+ set oldid [lindex $displayorder $selectedline]
+ set newid $rowmenuid
+ } else {
+ set oldid $rowmenuid
+ set newid [lindex $displayorder $selectedline]
+ }
+ addtohistory [list doseldiffdiff $oldid $newid]
+ doseldiffdiff $oldid $newid
+}
+
+proc doseldiffdiff {oldid newid} {
+ global ctext
+ global commitinfo
+
+ $ctext conf -state normal
+ clear_ctext
+ init_flist "Top"
+ $ctext insert end "From Commit "
+ $ctext insert end $oldid link0
+ setlink $oldid link0
+ $ctext insert end "\n "
+ $ctext insert end [lindex $commitinfo($oldid) 0]
+ $ctext insert end "\n\nTo Commit "
+ $ctext insert end $newid link1
+ setlink $newid link1
+ $ctext insert end "\n "
+ $ctext insert end [lindex $commitinfo($newid) 0]
+ $ctext insert end "\n"
+ $ctext insert end "\n"
+ $ctext conf -state disabled
+ $ctext tag remove found 1.0 end
+
+ set diff [exec git diff-diff $oldid $newid]
+ $ctext conf -state normal
+ $ctext insert end "\n"
+ $ctext insert end $diff
+ $ctext conf -state disabled
+}
+
proc mkpatch {} {
global rowmenuid currentid commitinfo patchtop patchnum
--
1.5.4.rc0.37.geff3a-dirty
^ permalink raw reply related
* [RFC 3/4] gitk: Refactor getblobdiffline to split off adddiffline
From: Steffen Prohaska @ 2007-12-15 16:51 UTC (permalink / raw)
To: git; +Cc: Steffen Prohaska
In-Reply-To: <1197737505599-git-send-email-prohaska@zib.de>
getblobdiffline used to read from a file descriptor, parsed
the line read, and displayed the line nicely formatted.
Parsing and displaying the line is split off to a separate
function adddiffline.
---
gitk-git/gitk | 30 +++++++++++++++++++-----------
1 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index ca121e4..3c4ec03 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -5324,18 +5324,11 @@ proc makediffhdr {fname ids} {
$ctext insert $curdiffstart "$pad $fname $pad" filesep
}
-proc getblobdiffline {bdf ids} {
+proc adddiffline {line ids} {
global diffids blobdifffd ctext curdiffstart
global diffnexthead diffnextnote difffilestart
global diffinhdr treediffs
- set nr 0
- $ctext conf -state normal
- while {[incr nr] <= 1000 && [gets $bdf line] >= 0} {
- if {$ids != $diffids || $bdf != $blobdifffd($ids)} {
- close $bdf
- return 0
- }
if {![string compare -length 11 "diff --git " $line]} {
# trim off "diff --git "
set line [string range $line 11 end]
@@ -5357,7 +5350,7 @@ proc getblobdiffline {bdf ids} {
if {!(($l & 1) && [string index $line $i] eq " " &&
[string range $line 2 [expr {$i - 1}]] eq \
[string range $line [expr {$i + 3}] end])} {
- continue
+ return
}
# unescape if quoted and chop off the a/ from the front
if {[string index $line 0] eq "\""} {
@@ -5391,10 +5384,10 @@ proc getblobdiffline {bdf ids} {
makediffhdr $fname $ids
} elseif {[string compare -length 3 $line "---"] == 0} {
# do nothing
- continue
+ return
} elseif {[string compare -length 3 $line "+++"] == 0} {
set diffinhdr 0
- continue
+ return
}
$ctext insert end "$line\n" filesep
@@ -5411,6 +5404,21 @@ proc getblobdiffline {bdf ids} {
$ctext insert end "$line\n" hunksep
}
}
+}
+
+proc getblobdiffline {bdf ids} {
+ global diffids blobdifffd ctext curdiffstart
+ global diffnexthead diffnextnote difffilestart
+ global diffinhdr treediffs
+
+ set nr 0
+ $ctext conf -state normal
+ while {[incr nr] <= 1000 && [gets $bdf line] >= 0} {
+ if {$ids != $diffids || $bdf != $blobdifffd($ids)} {
+ close $bdf
+ return 0
+ }
+ adddiffline $line $ids
}
$ctext conf -state disabled
if {[eof $bdf]} {
--
1.5.4.rc0.37.geff3a-dirty
^ permalink raw reply related
* [RFC 1/4] Add diff-diff, which compares the diffs of two commits
From: Steffen Prohaska @ 2007-12-15 16:51 UTC (permalink / raw)
To: git; +Cc: Steffen Prohaska
The following patch series adds experimental diff-diff support.
It adds a very basic command line version and experimental gitk
support for displaying the differences between the patches
associated with two commits.
"git diff-diff commit1 commit2" displays the differences between
the changes introduced by commit1 and commit2. This is displayed
as a unified diff between the two patches.
In gitk you can select one commit, right click on a second
commit, and select "Diff Diff selected -> this" to display the
changes between the patches for the two commits. Highlighting
of the result could certainly be improved. But it is already
kind of helpful.
This can, for example, be used to compare a first version of a
patch with an improved version of the same patch. In this case
it is helpful to display the difference between the patches (not
the files changed). If you commented on the first version, you
may just want to check if the original author improved the patch
according to your comments.
At this point, I'm only seeking comments about the general direction.
The patches should not be applied to git.git.
- Do you think something like this would be helpful?
- Are similar approaches already available?
- How do you use git to support code review; besides discussing
patches on mailing lists?
Steffen
---
Makefile | 3 ++-
git-diff-diff.sh | 22 ++++++++++++++++++++++
2 files changed, 24 insertions(+), 1 deletions(-)
create mode 100755 git-diff-diff.sh
diff --git a/Makefile b/Makefile
index b9fe40b..2e015ad 100644
--- a/Makefile
+++ b/Makefile
@@ -227,7 +227,8 @@ SCRIPT_SH = \
git-lost-found.sh git-quiltimport.sh git-submodule.sh \
git-filter-branch.sh \
git-stash.sh \
- git-browse--help.sh
+ git-browse--help.sh \
+ git-diff-diff.sh
SCRIPT_PERL = \
git-add--interactive.perl \
diff --git a/git-diff-diff.sh b/git-diff-diff.sh
new file mode 100755
index 0000000..aa402b2
--- /dev/null
+++ b/git-diff-diff.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+OPTIONS_KEEPDASHDASH=
+OPTIONS_SPEC="\
+git-diff-diff <commit> <commit>
+--
+"
+
+. git-sh-setup
+require_work_tree
+
+[ $# = 3 ] || usage
+
+from=$(git rev-parse --verify $2) || exit
+to=$(git rev-parse --verify $3) || exit
+
+git show $from >.git-commit-$from
+git show $to >.git-commit-$to
+
+diff -u .git-commit-$from .git-commit-$to
+
+rm .git-commit-$from .git-commit-$to
--
1.5.4.rc0.37.geff3a-dirty
^ permalink raw reply related
* [RFC 4/4] gitk: Use adddiffline to nicely format diff-diff
From: Steffen Prohaska @ 2007-12-15 16:51 UTC (permalink / raw)
To: git; +Cc: Steffen Prohaska
In-Reply-To: <11977375051617-git-send-email-prohaska@zib.de>
---
gitk-git/gitk | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 3c4ec03..31b2b5f 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -6059,8 +6059,9 @@ proc doseldiffdiff {oldid newid} {
set diff [exec git diff-diff $oldid $newid]
$ctext conf -state normal
- $ctext insert end "\n"
- $ctext insert end $diff
+ foreach line [split $diff "\n"] {
+ adddiffline $line [list $oldid $newid]
+ }
$ctext conf -state disabled
}
--
1.5.4.rc0.37.geff3a-dirty
^ permalink raw reply related
* Re: [RFC 1/4] Add diff-diff, which compares the diffs of two commits
From: Johannes Schindelin @ 2007-12-15 16:55 UTC (permalink / raw)
To: Steffen Prohaska; +Cc: git
In-Reply-To: <1197737505128-git-send-email-prohaska@zib.de>
Hi,
On Sat, 15 Dec 2007, Steffen Prohaska wrote:
> The following patch series adds experimental diff-diff support. It adds
> a very basic command line version and experimental gitk support for
> displaying the differences between the patches associated with two
> commits.
I briefly considered adding something like interdiff a year ago, but
decided that installing patchutils and having an alias was enough for my
needs.
IOW I do not need this to be a git command.
Ciao,
Dscho
^ permalink raw reply
* Re: [RFC 1/4] Add diff-diff, which compares the diffs of two commits
From: Björn Steinbrink @ 2007-12-15 17:04 UTC (permalink / raw)
To: Steffen Prohaska; +Cc: git
In-Reply-To: <1197737505128-git-send-email-prohaska@zib.de>
On 2007.12.15 17:51:42 +0100, Steffen Prohaska wrote:
> The following patch series adds experimental diff-diff support.
[...]
> At this point, I'm only seeking comments about the general direction.
> The patches should not be applied to git.git.
>
> - Do you think something like this would be helpful?
I think I might use it to e.g. compare stuff when upstream modified the
patch I submitted.
> - Are similar approaches already available?
interdiff from patchutils. Probably interdiff would also be a better
name than diff-diff, just to be consistent with what is already there.
And using interdiff instead of plain diff in your script might also
yield better results (I didn't use interdiff that often yet).
Björn
^ permalink raw reply
* Re: [PATCH] Replace the cryptic messages from "git stash show".
From: Jing Xue @ 2007-12-15 17:08 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7v63z0o59r.fsf@gitster.siamese.dyndns.org>
On Fri, Dec 14, 2007 at 10:12:32PM -0800, Junio C Hamano wrote:
>
> Is it just me who feels that the added code is much worse than the
> disease?
I wouldn't be surprised. Shell scripting is by no means my long suit -
in fact, I am not even sure it's "a suit" of mine at all. I didn't like
what I saw and basically had two options:
1. Send a "this is not user friendly" rant and get beaten up by "why
don't you even try?"
2. Try and hack together something, submit it, and keep fixing it until
it makes it - and learn something in the process, maybe at the price of
being mocked at, but I don't care.
In particular, as far as I _could_ see, there are probably at least one
place I'm doing something potentially absurd, but couldn't figure out
anything better:
I'm not sure how to test if there is a stash name specified, so I
tried:
test "$flags" = "$@"
but then it breaks when $@ has a space in it. Hence the pointless
assignment to $arguments first.
The reason I removed the --default option to rev-parse is that it
doesn't distinguish between no stash name or an invalid one.
I'm sure there are other things people don't like - some because my
shell scripting sucks, some others maybe because of style differences.
At any rate, I'm open to criticism. So bring it on. 8-)
--
Jing Xue
^ 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