* Re: git-pull - strange (copy/rename) messages ?!
From: Petr Baudis @ 2005-11-01 23:36 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Daniel Barkalow, git
In-Reply-To: <7vu0ew6jf3.fsf@assigned-by-dhcp.cox.net>
Dear diary, on Wed, Nov 02, 2005 at 12:24:32AM CET, I got a letter
where Junio C Hamano <junkio@cox.net> told me that...
> Daniel Barkalow <barkalow@iabervon.org> writes:
>
> > I think it's more confusing for the system to report Z differently from
> > other things, because there's nothing special about what it found, except
> > that Z happens to be last.
>
> What would we get for a simple "mv A B and nothing else" case if
> we follow your proposal and Pasky's? What about "cp A B and
> nothing else" case?
In case of my proposal, you get the mv and cp as usual, since there are
no multiple rename candidates for A.
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.
^ permalink raw reply
* Re: [PATCH gitweb] Visually indicating patch size with horizontal bars
From: Martin Langhoff @ 2005-11-01 23:33 UTC (permalink / raw)
To: Petr Baudis; +Cc: Chris Shoemaker, Kay Sievers, git
In-Reply-To: <20051101233035.GB1431@pasky.or.cz>
On 11/2/05, Petr Baudis <pasky@suse.cz> wrote:
> What about having the color indicate the number of affected files (let's
> say on a blue..red scale) and the width the size of patch?
I'm a /little bit/ colour blind on the red scale -- so I vote for 2
bars, each half the heigth of the current bar. ;-)
martin
^ permalink raw reply
* Re: [PATCH gitweb] Visually indicating patch size with horizontal bars
From: Petr Baudis @ 2005-11-01 23:30 UTC (permalink / raw)
To: Chris Shoemaker; +Cc: Kay Sievers, git
In-Reply-To: <20051028023833.GA19939@pe.Belkin>
Dear diary, on Fri, Oct 28, 2005 at 04:38:33AM CEST, I got a letter
where Chris Shoemaker <c.shoemaker@cox.net> told me that...
> Here's a side-by-side comparison. Open two browser tabs and flip between them:
>
> http://www.codesifter.com/cgi-bin/gitweb-difftreeP.cgi?p=git.git;a=shortlog
> http://www.codesifter.com/cgi-bin/gitweb-difftreeNames.cgi?p=git.git;a=shortlog
>
> I've used a project you all are familar with, and that has more than
> two files. The first page uses 'git-diff-tree -p $hash|wc -l'. The
> second page uses 'git-diff-tree -r --name-only|wc -l'. (Oh and I have
> a merge indicator now.)
>
> How do they compare for showing damage-potential? I think they both
> do a reasonable job. I think the full patch diff is a bit better, but
> it does cost.
What about having the color indicate the number of affected files (let's
say on a blue..red scale) and the width the size of patch?
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.
^ permalink raw reply
* [PATCH] Point git-clone man-page to git-pull and friends for remote repo syntax.
From: Andreas Ericsson @ 2005-11-01 23:25 UTC (permalink / raw)
Signed-off-by: Andreas Ericsson <ae@op5.se>
---
Documentation/git-clone.txt | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
applies-to: 10d2c80712a3ff324ddd1c0f37b2b0e8bfda554c
189416bb09953a7268d13ea38cbef6bd61485863
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt
index dd92cde..1d23be5 100644
--- a/Documentation/git-clone.txt
+++ b/Documentation/git-clone.txt
@@ -48,10 +48,8 @@ OPTIONS
run on the other end.
<repository>::
- The (possibly remote) repository to clone from. It can
- be an "rsync://host/dir" URL, an "http://host/dir" URL,
- or [<host>:]/dir notation that is used by 'git-clone-pack'.
- Currently http transport is not supported.
+ The repository to clone from. See the man-page for
+ git-pull, git-fetch or git-push for syntax explanation.
<directory>::
The name of a new directory to be cloned into. It is an
---
0.99.9.GIT
^ permalink raw reply related
* Re: git-pull - strange (copy/rename) messages ?!
From: Junio C Hamano @ 2005-11-01 23:24 UTC (permalink / raw)
To: Daniel Barkalow; +Cc: git
In-Reply-To: <Pine.LNX.4.64.0511011646070.25300@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> writes:
> I think it's more confusing for the system to report Z differently from
> other things, because there's nothing special about what it found, except
> that Z happens to be last.
What would we get for a simple "mv A B and nothing else" case if
we follow your proposal and Pasky's? What about "cp A B and
nothing else" case?
^ permalink raw reply
* [RFH] building docs with asciidoc 6.0.3
From: Junio C Hamano @ 2005-11-01 23:19 UTC (permalink / raw)
To: git
Debian sarge comes with asciidoc 6.0.3 which does not have
xhtml11, so I whipped up this patch to work things around, but
unsuccessfully. The manpage backend seems to be busted.
There are three problems in our documentation source I am aware
of, with asciidoc 6.0.3. This patch only works around two of
them -- I have not found a good workaround for the other one.
* anchor generation by "Foo[[Bar]]" does not seem to work, but
can be worked around by spelling it out as "Foo anchor:Bar[]".
* blockquote style display element (for examples, look for
revert-branch-rebase.txt in the attached patch) cannot
contain lines that begin with '--'; it seems to confuse the
end-of-block detection logic. The patch works it around by
indenting the quoted material by one space (yuck).
* xml generated by manpage backend splits the refentry name at
the first dash, so 'git-cat-file(1)' manpage (and everybody
else whose name begins with 'git-') is generated in git.1. I
think this is a bug in asciidoc 6.0.3, and do not have a good
workaround.
Note that I am reluctant to take a patch to the Makefile rule
that lets xmlto to generate git.1 and renames it to
git-cat-file.1. The generated git-cat-file.xml file incorrectly
labels the refentry like this:
<refnamediv>
<refname>git</refname>
<refpurpose>cat-file - Provide content or type information
for repository objects</refpurpose>
but we would not know what other breakage there is.
In the meantime I plan to build my debs in a vanilla sarge
chrooted environment, updated minimally to use asciidoc 7.0.2.
Help from asciidoc savvy people are welcome.
---
Documentation/Makefile | 10 +++--
Documentation/asciidoc.conf | 4 ++
Documentation/git.txt | 4 +-
Documentation/howto/revert-branch-rebase.txt | 54 +++++++++++++-------------
Documentation/tutorial.txt | 24 ++++++------
debian/rules | 11 +++++
6 files changed, 61 insertions(+), 46 deletions(-)
applies-to: d6c9d63786e4bfb10982af5b9d84193a810c25f1
dc02b117c1493f4f54646b692ac169b4824766ae
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 3cfa360..4f308d5 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -1,6 +1,8 @@
MAN1_TXT=$(wildcard git-*.txt) gitk.txt
MAN7_TXT=git.txt
+XHTML_VER = xhtml11
+
DOC_HTML=$(patsubst %.txt,%.html,$(MAN1_TXT) $(MAN7_TXT))
ARTICLES = tutorial
@@ -62,7 +64,7 @@ clean:
rm -f *.xml *.html *.1 *.7 howto-index.txt howto/*.html
%.html : %.txt
- asciidoc -b xhtml11 -d manpage -f asciidoc.conf $<
+ asciidoc -b $(XHTML_VER) -d manpage -f asciidoc.conf $<
%.1 %.7 : %.xml
xmlto man $<
@@ -75,7 +77,7 @@ git.html: git.txt ../README
glossary.html : glossary.txt sort_glossary.pl
cat $< | \
perl sort_glossary.pl | \
- asciidoc -b xhtml11 - > glossary.html
+ asciidoc -b $(XHTML_VER) - > glossary.html
howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
rm -f $@+ $@
@@ -83,13 +85,13 @@ howto-index.txt: howto-index.sh $(wildca
mv $@+ $@
$(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
- asciidoc -b xhtml11 $*.txt
+ asciidoc -b $(XHTML_VER) $*.txt
WEBDOC_DEST = /pub/software/scm/git/docs
$(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
rm -f $@+ $@
- sed -e '1,/^$$/d' $? | asciidoc -b xhtml11 - >$@+
+ sed -e '1,/^$$/d' $? | asciidoc -b $(XHTML_VER) - >$@+
mv $@+ $@
install-webdoc : html
diff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf
index fa0877d..d2b9d53 100644
--- a/Documentation/asciidoc.conf
+++ b/Documentation/asciidoc.conf
@@ -23,4 +23,8 @@ ifdef::backend-xhtml11[]
<a href="{target}.html">{target}{0?({0})}</a>
endif::backend-xhtml11[]
+ifdef::backend-xhtml[]
+[gitlink-inlinemacro]
+<a href="{target}.html">{target}{0?({0})}</a>
+endif::backend-xhtml[]
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 59d0dc8..653fc03 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -573,8 +573,8 @@ git Diffs
gitlink:git-diff-files[1];
gitlink:git-diff-tree[1]
-Discussion[[Discussion]]
-------------------------
+Discussion anchor:Discussion[]
+----------------------------
include::../README[]
Author
diff --git a/Documentation/howto/revert-branch-rebase.txt b/Documentation/howto/revert-branch-rebase.txt
index e4cce5b..b69832e 100644
--- a/Documentation/howto/revert-branch-rebase.txt
+++ b/Documentation/howto/revert-branch-rebase.txt
@@ -31,17 +31,17 @@ the change I would want to undo. Furthe
merge introduced 5 commits or so:
------------------------------------------------
-$ git show-branch --more=4 master master^2 | head
-! [master] Merge refs/heads/portable from http://www.cs.berkeley....
- ! [master^2] Replace C99 array initializers with code.
---
-+ [master] Merge refs/heads/portable from http://www.cs.berkeley....
-++ [master^2] Replace C99 array initializers with code.
-++ [master^2~1] Replace unsetenv() and setenv() with older putenv().
-++ [master^2~2] Include sys/time.h in daemon.c.
-++ [master^2~3] Fix ?: statements.
-++ [master^2~4] Replace zero-length array decls with [].
-+ [master~1] tutorial note about git branch
+ $ git show-branch --more=4 master master^2 | head
+ ! [master] Merge refs/heads/portable from http://www.cs.berkeley....
+ ! [master^2] Replace C99 array initializers with code.
+ --
+ + [master] Merge refs/heads/portable from http://www.cs.berkeley....
+ ++ [master^2] Replace C99 array initializers with code.
+ ++ [master^2~1] Replace unsetenv() and setenv() with older putenv().
+ ++ [master^2~2] Include sys/time.h in daemon.c.
+ ++ [master^2~3] Fix ?: statements.
+ ++ [master^2~4] Replace zero-length array decls with [].
+ + [master~1] tutorial note about git branch
------------------------------------------------
The '--more=4' above means "after we reach the merge base of refs,
@@ -180,20 +180,20 @@ Committed merge 7fb9b7262a1d1e0a47bbfdcb
And the final repository status looks like this:
------------------------------------------------
-$ git show-branch --more=1 master pu rc
-! [master] Revert "Replace zero-length array decls with []."
- ! [pu] git-repack: Add option to repack all objects.
- * [rc] Merge refs/heads/master from .
----
- + [pu] git-repack: Add option to repack all objects.
- + [pu~1] More documentation updates.
- + [pu~2] Show commits in topo order and name all commits.
- + [pu~3] mailinfo and applymbox updates
- + [pu~4] Document "git cherry-pick" and "git revert"
- + [pu~5] Remove git-apply-patch-script.
- + [pu~6] Redo "revert" using three-way merge machinery.
- + [rc] Merge refs/heads/master from .
-+++ [master] Revert "Replace zero-length array decls with []."
- + [rc~1] Merge refs/heads/master from .
-+++ [master~1] Merge refs/heads/portable from http://www.cs.berkeley....
+ $ git show-branch --more=1 master pu rc
+ ! [master] Revert "Replace zero-length array decls with []."
+ ! [pu] git-repack: Add option to repack all objects.
+ * [rc] Merge refs/heads/master from .
+ ---
+ + [pu] git-repack: Add option to repack all objects.
+ + [pu~1] More documentation updates.
+ + [pu~2] Show commits in topo order and name all commits.
+ + [pu~3] mailinfo and applymbox updates
+ + [pu~4] Document "git cherry-pick" and "git revert"
+ + [pu~5] Remove git-apply-patch-script.
+ + [pu~6] Redo "revert" using three-way merge machinery.
+ + [rc] Merge refs/heads/master from .
+ +++ [master] Revert "Replace zero-length array decls with []."
+ + [rc~1] Merge refs/heads/master from .
+ +++ [master~1] Merge refs/heads/portable from http://www.cs.berkeley....
------------------------------------------------
diff --git a/Documentation/tutorial.txt b/Documentation/tutorial.txt
index b9f737e..f654c3c 100644
--- a/Documentation/tutorial.txt
+++ b/Documentation/tutorial.txt
@@ -1466,18 +1466,18 @@ two 'git resolve' commands in a row, you
branch heads (this is known as 'making an Octopus'):
------------
-$ git pull . commit-fix diff-fix
-$ git show-branch
-! [commit-fix] Fix commit message normalization.
- ! [diff-fix] Fix rename detection.
- * [master] Octopus merge of branches 'diff-fix' and 'commit-fix'
----
- + [master] Octopus merge of branches 'diff-fix' and 'commit-fix'
-+ + [commit-fix] Fix commit message normalization.
- ++ [diff-fix] Fix rename detection.
- ++ [diff-fix~1] Better common substring algorithm.
- + [master~1] Release candidate #1
-+++ [master~2] Pretty-print messages.
+ $ git pull . commit-fix diff-fix
+ $ git show-branch
+ ! [commit-fix] Fix commit message normalization.
+ ! [diff-fix] Fix rename detection.
+ * [master] Octopus merge of branches 'diff-fix' and 'commit-fix'
+ ---
+ + [master] Octopus merge of branches 'diff-fix' and 'commit-fix'
+ + + [commit-fix] Fix commit message normalization.
+ ++ [diff-fix] Fix rename detection.
+ ++ [diff-fix~1] Better common substring algorithm.
+ + [master~1] Release candidate #1
+ +++ [master~2] Pretty-print messages.
------------
Note that you should not do Octopus because you can. An octopus
diff --git a/debian/rules b/debian/rules
index 568d430..a944f3f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -41,7 +41,16 @@ MAN_DESTDIR := $(DESTDIR)/$(MANDIR)
build: debian/build-stamp
debian/build-stamp:
dh_testdir
- $(MAKE) prefix=$(PREFIX) PYTHON_PATH=/usr/bin/python2.4 all doc test
+ if test -f /etc/asciidoc/xhtml11.conf; \
+ then \
+ XHTML_VER=xhtml11; \
+ else \
+ XHTML_VER=xhtml; \
+ fi && \
+ $(MAKE) prefix=$(PREFIX) \
+ XHTML_VER=$$XHTML_VER \
+ PYTHON_PATH=/usr/bin/python2.4 \
+ all doc test
touch debian/build-stamp
debian-clean:
---
0.99.9.GIT
^ permalink raw reply related
* Re: git-pull - strange (copy/rename) messages ?!
From: Petr Baudis @ 2005-11-01 23:06 UTC (permalink / raw)
To: Daniel Barkalow; +Cc: Junio C Hamano, Linus Torvalds, git
In-Reply-To: <Pine.LNX.4.64.0511011646070.25300@iabervon.org>
Dear diary, on Tue, Nov 01, 2005 at 11:03:26PM CET, I got a letter
where Daniel Barkalow <barkalow@iabervon.org> told me that...
> On Tue, 1 Nov 2005, Junio C Hamano wrote:
> > Would it be easier to read if we say A was renamed to B, and A
> > was renamed to C, and A was renamed to D, ...? I think the
> > current output is easier to understand than that. B-Y gets
> > labelled as copy of A and Z gets labelled as rename.
>
> I think it's more confusing for the system to report Z differently from
> other things, because there's nothing special about what it found, except
> that Z happens to be last.
I agree, but I'd prefer it to be labelled as a copy+remove instead of a
rename in case it is ambiguous. Just a simple rule - if the file was
removed and you get multiple rename candidates, mark all of them as
'copy'.
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
VI has two modes: the one in which it beeps and the one in which
it doesn't.
^ permalink raw reply
* [PATCH 1/4] Client side of user-relative paths, take two.
From: Andreas Ericsson @ 2005-11-01 22:59 UTC (permalink / raw)
See this discussion, "[RFC] GIT paths", on the git-list:
http://www.gelato.unsw.edu.au/archives/git/0510/10924.html
In particular, the client side now passes identical paths for these two:
ssh://host.xz/~junio/repo
host.xz:~junio/repo
A friendly error message is produced if no path is specified.
Signed-off-by: Andreas Ericsson <ae@op5.se>
---
connect.c | 53 ++++++++++++++++++++++++++++++++++-------------------
1 files changed, 34 insertions(+), 19 deletions(-)
applies-to: e39c96179f2cc5064a0255057b8e8a8863594536
22ca6db517baf2bb4824a971408543d9bd956209
diff --git a/connect.c b/connect.c
index c2badc7..9150ad2 100644
--- a/connect.c
+++ b/connect.c
@@ -460,26 +460,41 @@ int git_connect(int fd[2], char *url, co
pid_t pid;
enum protocol protocol;
- host = NULL;
- path = url;
- colon = strchr(url, ':');
- protocol = PROTO_LOCAL;
- if (colon) {
- *colon = 0;
+ protocol = PROTO_SSH;
+ host = strstr(url, "://");
+ if(host) {
+ *host = '\0';
+ protocol = get_protocol(url);
+ host += 3;
+ }
+ else
host = url;
- path = colon+1;
- protocol = PROTO_SSH;
- if (!memcmp(path, "//", 2)) {
- char *slash = strchr(path + 2, '/');
- if (slash) {
- int nr = slash - path - 2;
- memmove(path, path+2, nr);
- path[nr] = 0;
- protocol = get_protocol(url);
- host = path;
- path = slash;
- }
- }
+
+ path = strchr(host, '/');
+ colon = strchr(host, ':');
+
+ /* We keep server-side code simple by handling the difference
+ * between these two on the client side:
+ * ssh://host.xz/~user/repo
+ * host.xz:~repo
+ */
+ if (protocol == PROTO_SSH && colon && (!path || colon < path)) {
+ *colon = 0;
+ path = colon + 1;
+ }
+
+ if(!path || !*path)
+ die("No path specified. Try '%s%s/path/to/repo'", url, colon ? ":" : "");
+
+ /* null-terminate host part and point path to ~ for URL's like this:
+ * ssh://host.xz/~user/repo
+ */
+ if(!colon && *(path + 1) == '~')
+ *path++ = '\0';
+ else {
+ colon = path;
+ path = strdup(path);
+ *colon = '\0';
}
if (protocol == PROTO_GIT)
---
0.99.9.GIT
^ permalink raw reply related
* [PATCH 4/4] git-daemon support for user-relative paths.
From: Andreas Ericsson @ 2005-11-01 22:59 UTC (permalink / raw)
Dropped a fair amount of redundant functionality in favour of the library
code in path.c. git-upload-pack is now called with canonicalized paths.
Added option --strict-paths to retain old behaviour (documented).
Signed-off-by: Andreas Ericsson <ae@op5.se>
---
Documentation/git-daemon.txt | 17 +++++-
daemon.c | 128 ++++++++++++++----------------------------
2 files changed, 58 insertions(+), 87 deletions(-)
applies-to: c40ce0cb704af8d7d1d655bcf709e7621db60e0e
e35eb905a06718894a6c79f73d763122fff2a61a
diff --git a/Documentation/git-daemon.txt b/Documentation/git-daemon.txt
index 67c5f22..25f03df 100644
--- a/Documentation/git-daemon.txt
+++ b/Documentation/git-daemon.txt
@@ -8,7 +8,7 @@ git-daemon - A really simple server for
SYNOPSIS
--------
'git-daemon' [--verbose] [--syslog] [--inetd | --port=n] [--export-all]
- [--timeout=n] [--init-timeout=n] [directory...]
+ [--timeout=n] [--init-timeout=n] [--strict-paths] [directory...]
DESCRIPTION
-----------
@@ -29,10 +29,16 @@ This is ideally suited for read-only upd
OPTIONS
-------
+--strict-paths::
+ Match paths exactly (i.e. don't allow "/foo/repo" when the real path is
+ "/foo/repo.git" or "/foo/repo/.git") and don't do user-relative paths.
+ git-daemon will refuse to start when this option is enabled and no
+ whitelist is specified.
+
--export-all::
Allow pulling from all directories that look like GIT repositories
- (have the 'objects' subdirectory and a 'HEAD' file), even if they
- do not have the 'git-daemon-export-ok' file.
+ (have the 'objects' and 'refs' subdirectories as well as a 'HEAD' file),
+ even if they do not have the 'git-daemon-export-ok' file.
--inetd::
Have the server run as an inetd service.
@@ -57,6 +63,11 @@ OPTIONS
--verbose::
Log details about the incoming connections and requested files.
+<directory>::
+ A directory to add to the whitelist of allowed directory. Unless
+ --strict-paths is specified this will also include subdirectories
+ of each named directory.
+
Author
------
Written by Linus Torvalds <torvalds@osdl.org> and YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
diff --git a/daemon.c b/daemon.c
index c3f8641..7b36363 100644
--- a/daemon.c
+++ b/daemon.c
@@ -10,16 +10,18 @@
#include "pkt-line.h"
#include "cache.h"
-static int log_syslog;
+static int log_syslog = 0;
static int verbose;
static const char daemon_usage[] =
"git-daemon [--verbose] [--syslog] [--inetd | --port=n] [--export-all]\n"
-" [--timeout=n] [--init-timeout=n] [directory...]";
+" [--timeout=n] [--init-timeout=n] [--strict-paths] [directory...]";
/* List of acceptable pathname prefixes */
static char **ok_paths = NULL;
+static int strict_paths = 0;
+
/* If this is set, git-daemon-export-ok is not required */
static int export_all_trees = 0;
@@ -81,69 +83,49 @@ static void loginfo(const char *err, ...
va_end(params);
}
-static int path_ok(const char *dir)
+static const char *path_ok(const char *dir)
{
- const char *p = dir;
- char **pp;
- int sl, ndot;
-
- /* The pathname here should be an absolute path. */
- if ( *p++ != '/' )
- return 0;
-
- sl = 1; ndot = 0;
-
- for (;;) {
- if ( *p == '.' ) {
- ndot++;
- } else if ( *p == '\0' ) {
- /* Reject "." and ".." at the end of the path */
- if ( sl && ndot > 0 && ndot < 3 )
- return 0;
+ const char *path = is_git_repo(dir, strict_paths);
- /* Otherwise OK */
- break;
- } else if ( *p == '/' ) {
- /* Refuse "", "." or ".." */
- if ( sl && ndot < 3 )
- return 0;
- sl = 1;
- ndot = 0;
- } else {
- sl = ndot = 0;
- }
- p++;
+ /* No such directory or not a git archive */
+ if(!path) {
+ logerror("'%s': unable to chdir or not a git archive", dir);
+ return NULL;
}
if ( ok_paths && *ok_paths ) {
- int ok = 0;
- int dirlen = strlen(dir);
+ char **pp = NULL;
+ int dirlen = strlen(path);
for ( pp = ok_paths ; *pp ; pp++ ) {
int len = strlen(*pp);
- if ( len <= dirlen &&
- !strncmp(*pp, dir, len) &&
- (dir[len] == '/' || dir[len] == '\0') ) {
- ok = 1;
- break;
+ if ( len <= dirlen && !strncmp(*pp, path, len) ) {
+ if( path[len] == '\0' || (!strict_paths && path[len] == '/') )
+ return path;
}
}
-
- if ( !ok )
- return 0; /* Path not in whitelist */
+ }
+ else {
+ /* Be backwards compatible */
+ if(!strict_paths)
+ return path;
}
- return 1; /* Path acceptable */
+ logerror("'%s': not in whitelist", path);
+ return NULL; /* Fallthrough. Deny by default */
}
-static int set_dir(const char *dir)
+static int upload(char *dir)
{
- if (!path_ok(dir)) {
- errno = EACCES;
- return -1;
- }
+ /* Timeout as string */
+ char timeout_buf[64];
+ const char *path;
+
+ loginfo("Request for '%s'", dir);
- if ( chdir(dir) )
+ /* path_ok() canonicalizes the path, chdir()'s
+ * and does whitelist checking */
+ if(!(path = path_ok(dir)))
return -1;
/*
@@ -152,45 +134,16 @@ static int set_dir(const char *dir)
* We want a readable HEAD, usable "objects" directory, and
* a "git-daemon-export-ok" flag that says that the other side
* is ok with us doing this.
+ *
+ * path_ok() uses is_git_repo() though, so we only need to
+ * check if the path is exported.
*/
if (!export_all_trees && access("git-daemon-export-ok", F_OK)) {
+ logerror("'%s': not exported", path);
errno = EACCES;
return -1;
}
- if (access("objects/", X_OK) || access("HEAD", R_OK)) {
- errno = EINVAL;
- return -1;
- }
-
- /* If all this passed, we're OK */
- return 0;
-}
-
-static int upload(char *dir)
-{
- /* Try paths in this order */
- static const char *paths[] = { "%s", "%s/.git", "%s.git", "%s.git/.git", NULL };
- const char **pp;
- /* Enough for the longest path above including final null */
- int buflen = strlen(dir)+10;
- char *dirbuf = xmalloc(buflen);
- /* Timeout as string */
- char timeout_buf[64];
-
- loginfo("Request for '%s'", dir);
-
- for ( pp = paths ; *pp ; pp++ ) {
- snprintf(dirbuf, buflen, *pp, dir);
- if ( !set_dir(dirbuf) )
- break;
- }
-
- if ( !*pp ) {
- logerror("Cannot set directory '%s': %s", dir, strerror(errno));
- return -1;
- }
-
/*
* We'll ignore SIGTERM from now on, we have a
* good client.
@@ -200,7 +153,7 @@ static int upload(char *dir)
snprintf(timeout_buf, sizeof timeout_buf, "--timeout=%u", timeout);
/* git-upload-pack only ever reads stuff, so this is safe */
- execlp("git-upload-pack", "git-upload-pack", "--strict", timeout_buf, ".", NULL);
+ execlp("git-upload-pack", "git-upload-pack", "--strict", timeout_buf, path, NULL);
return -1;
}
@@ -216,7 +169,7 @@ static int execute(void)
if (len && line[len-1] == '\n')
line[--len] = 0;
- if (!strncmp("git-upload-pack /", line, 17))
+ if (!strncmp("git-upload-pack ", line, 16))
return upload(line+16);
logerror("Protocol error: '%s'", line);
@@ -615,6 +568,10 @@ int main(int argc, char **argv)
if (!strncmp(arg, "--init-timeout=", 15)) {
init_timeout = atoi(arg+15);
}
+ if (!strcmp(arg, "--strict-paths")) {
+ strict_paths = 1;
+ continue;
+ }
if (!strcmp(arg, "--")) {
ok_paths = &argv[i+1];
break;
@@ -626,6 +583,9 @@ int main(int argc, char **argv)
usage(daemon_usage);
}
+ if(strict_paths && (!ok_paths || !*ok_paths))
+ die("git-daemon: option --strict-paths requires a whitelist");
+
if (inetd_mode) {
fclose(stderr); //FIXME: workaround
return execute();
---
0.99.9.GIT
^ permalink raw reply related
* [PATCH 2/4] Library code for user-relative paths.
From: Andreas Ericsson @ 2005-11-01 22:59 UTC (permalink / raw)
See this discussion, "[RFC] GIT paths", on the git-list:
http://www.gelato.unsw.edu.au/archives/git/0510/10924.html
This patch provides the work-horse of the user-relative paths, using Linus'
idea of a blind chdir() and getcwd(), which makes it remarkably simple.
Signed-off-by: Andreas Ericsson <ae@op5.se>
---
cache.h | 1 +
path.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 73 insertions(+), 0 deletions(-)
applies-to: bf640ae3d5bb5f5f283c62d4f5198a3c5e5086f0
1c4e7bb2383e2b67f0e877a46ea1eba4ec7e45e7
diff --git a/cache.h b/cache.h
index 677c6ac..aea2097 100644
--- a/cache.h
+++ b/cache.h
@@ -190,6 +190,7 @@ extern int trust_executable_bit;
/* Return a statically allocated filename matching the sha1 signature */
extern char *mkpath(const char *fmt, ...) __attribute__((format (printf, 1, 2)));
+extern const char *is_git_repo(const char *path, int strict);
extern char *git_path(const char *fmt, ...) __attribute__((format (printf, 1, 2)));
extern char *sha1_file_name(const unsigned char *sha1);
extern char *sha1_pack_name(const unsigned char *sha1);
diff --git a/path.c b/path.c
index 495d17c..4f4018d 100644
--- a/path.c
+++ b/path.c
@@ -11,6 +11,7 @@
* which is what it's designed for.
*/
#include "cache.h"
+#include <pwd.h>
static char pathname[PATH_MAX];
static char bad_path[] = "/bad-path/";
@@ -89,3 +90,74 @@ char *safe_strncpy(char *dest, const cha
return dest;
}
+
+static const char *current_dir()
+{
+ return getcwd(pathname, sizeof(pathname));
+}
+
+/* Take a raw path from is_git_repo() and canonicalize it using Linus'
+ * idea of a blind chdir() and getcwd(). */
+static const char *canonical_path(const char *path, int strict)
+{
+ const char *dir = path;
+
+ if(strict && *dir != '/')
+ return NULL;
+
+ if(*dir == '~') { /* user-relative path */
+ struct passwd *pw;
+ char *slash = NULL;
+
+ dir++;
+ /* '~/' and '~' (no slash) means users own home-dir */
+ if(!*dir || *dir == '/')
+ pw = getpwuid(getuid());
+ else {
+ if((slash = strchr(dir, '/'))) {
+ *slash = '\0';
+ pw = getpwnam(dir);
+ *slash = '/';
+ }
+ else
+ pw = getpwnam(dir);
+ }
+
+ /* make sure we got something back that we can chdir() to */
+ if(!pw || chdir(pw->pw_dir) < 0)
+ return NULL;
+
+ if(slash && *slash + 1)
+ dir = slash + 1;
+ else
+ dir = current_dir();
+ }
+
+ /* ~foo/path/to/repo is now path/to/repo and we're in foo's homedir */
+ if(chdir(dir) < 0)
+ return NULL;
+
+ return current_dir();
+}
+
+const char *is_git_repo(const char *path, int strict)
+{
+ if(!path)
+ return NULL;
+
+ if(!canonical_path(path, strict)) {
+ if(strict || !canonical_path(mkpath("%s.git", path), strict))
+ return NULL;
+ }
+
+ /* This is perfectly safe, and people tend to think of the directory
+ * where they ran git-init-db as their repository, so humour them. */
+ (void)chdir(".git");
+
+ if(access("objects", X_OK) == 0 && access("refs", X_OK) == 0) {
+ putenv("GIT_DIR=.");
+ return current_dir();
+ }
+
+ return NULL;
+}
---
0.99.9.GIT
^ permalink raw reply related
* [PATCH 3/4] Server-side support for user-relative paths.
From: Andreas Ericsson @ 2005-11-01 22:59 UTC (permalink / raw)
Remove the redundant code from {receive,upload}-pack.c in favour of the
library code in path.c (previous patch) with documentation of the changes
to the affected programs.
Signed-off-by: Andreas Ericsson <ae@op5.se>
---
Documentation/pull-fetch-param.txt | 35 +++++++++++++++++++++++++++--------
receive-pack.c | 13 ++-----------
upload-pack.c | 13 ++-----------
3 files changed, 31 insertions(+), 30 deletions(-)
applies-to: 17cf0474b857a396561f2def13ac6ac6b01e1e33
dd1ddd3d653b28bd57092f0e243efa545cd214d3
diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt
index e8db9d7..33ee02e 100644
--- a/Documentation/pull-fetch-param.txt
+++ b/Documentation/pull-fetch-param.txt
@@ -1,16 +1,35 @@
<repository>::
- The "remote" repository to pull from. One of the
- following notations can be used to name the repository
- to pull from:
+ The repository to pull/fetch from or push to. The following
+ notations can be used to name the repository:
+
===============================================================
-- Rsync URL: rsync://remote.machine/path/to/repo.git/
-- HTTP(s) URL: http://remote.machine/path/to/repo.git/
-- git URL: git://remote.machine/path/to/repo.git/
- or remote.machine:/path/to/repo.git/
-- Local directory: /path/to/repo.git/
+- rsync://host.xz/path/to/repo.git/
+- http://host.xz/path/to/repo.git/
+- https://host.xz/path/to/repo.git/
+- git://host.xz/path/to/repo.git/
+- git://host.xz/~user/path/to/repo.git/
+- ssh://host.xz/path/to/repo.git/
+- ssh://host.xz/~user/path/to/repo.git/
===============================================================
+
+ SSH Is the default transport protocol and also supports an
+ scp-like syntax. Both syntaxes support username expansion,
+ as does the git-protocol. The following two are identical
+ to the last two above:
++
+===============================================================
+- host.xz:/path/to/repo.git/
+- host.xz:~user/path/to/repo.git/
+===============================================================
++
+ To sync with a local directory, use:
++
+===============================================================
+- /path/to/repo.git/
+===============================================================
++
+Note that you can't push via HTTP or HTTPS.
++
In addition to the above, as a short-hand, the name of a
file in $GIT_DIR/remotes directory can be given; the
named file should be in the following format:
diff --git a/receive-pack.c b/receive-pack.c
index 8f157bc..2c56018 100644
--- a/receive-pack.c
+++ b/receive-pack.c
@@ -265,18 +265,9 @@ int main(int argc, char **argv)
if (!dir)
usage(receive_pack_usage);
- /* chdir to the directory. If that fails, try appending ".git" */
- if (chdir(dir) < 0) {
- if (chdir(mkpath("%s.git", dir)) < 0)
- die("unable to cd to %s", dir);
- }
-
- /* If we have a ".git" directory, chdir to it */
- chdir(".git");
- putenv("GIT_DIR=.");
+ if(!is_git_repo(dir, 0))
+ die("'%s': unable to chdir or not a git archive", dir);
- if (access("objects", X_OK) < 0 || access("refs/heads", X_OK) < 0)
- die("%s doesn't appear to be a git directory", dir);
write_head_info();
/* EOF */
diff --git a/upload-pack.c b/upload-pack.c
index c5eff21..86e2a61 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -275,18 +275,9 @@ int main(int argc, char **argv)
usage(upload_pack_usage);
dir = argv[i];
- /* chdir to the directory. If that fails, try appending ".git" */
- if (chdir(dir) < 0) {
- if (strict || chdir(mkpath("%s.git", dir)) < 0)
- die("git-upload-pack unable to chdir to %s", dir);
- }
- if (!strict)
- chdir(".git");
+ if(!is_git_repo(dir, strict))
+ die("'%s': unable to chdir or not a git archive", dir);
- if (access("objects", X_OK) || access("refs", X_OK))
- die("git-upload-pack: %s doesn't seem to be a git archive", dir);
-
- putenv("GIT_DIR=.");
upload_pack();
return 0;
}
---
0.99.9.GIT
^ permalink raw reply related
* [PATCH 0/4] User-relative paths, take two.
From: Andreas Ericsson @ 2005-11-01 22:44 UTC (permalink / raw)
To: Git Mailing List
I've reworked the user-relative paths according to the discussion "[RFC]
GIT paths" started by Junio. In addition I've added a '--strict-paths'
option to git-daemon.
I think I got everything right. At least it builds nicely and works as
expected.
Comments welcome. Upstream inclusion even more so. :)
Btw. I'll have some more patches for git-daemon soon (--server-root and
--userdir) which will rely on these patches making it in. Should I hold
off on that for now?
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
^ permalink raw reply
* [PATCH] Strip any trailing slash on destination argument
From: Josef Weidendorfer @ 2005-11-01 22:46 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
Needed because generating a target paths will add another slash.
This fixes e.g. "git-mv file dir/", which removed "file" from
version control by renaming it to "dir//file", as
git-update-index does not accept such paths.
Thanks goes to Ben Lau for noting this bug.
Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
---
git-mv.perl | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
applies-to: e39c96179f2cc5064a0255057b8e8a8863594536
e91e743bdf6d246b279fc7f8f5f7ab733690249b
diff --git a/git-mv.perl b/git-mv.perl
index 17e35b0..a21d87e 100755
--- a/git-mv.perl
+++ b/git-mv.perl
@@ -54,6 +54,8 @@ my ($src, $dst, $base, $dstDir);
my $argCount = scalar @ARGV;
if (-d $ARGV[$argCount-1]) {
$dstDir = $ARGV[$argCount-1];
+ # remove any trailing slash
+ $dstDir =~ s/\/$//;
@srcArgs = @ARGV[0..$argCount-2];
foreach $src (@srcArgs) {
---
0.99.9
^ permalink raw reply related
* Re: git-mv dest ending with slash would deletes file only
From: Josef Weidendorfer @ 2005-11-01 22:46 UTC (permalink / raw)
To: git
In-Reply-To: <4366ECF1.1010401@ust.hk>
On Tuesday 01 November 2005 05:20, Ben Lau wrote:
> $ git-mv entry.c Documentation/
> Ignoring path Documentation//entry.c
Instead of mangling all destination paths, I only
would strip a trailing slash of the destination argument.
See my other mail with the patch.
Thanks for noting this bug,
Josef
^ permalink raw reply
* Re: git-pull - strange (copy/rename) messages ?!
From: Daniel Barkalow @ 2005-11-01 22:03 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Linus Torvalds, git
In-Reply-To: <7vbr149sbs.fsf@assigned-by-dhcp.cox.net>
On Tue, 1 Nov 2005, Junio C Hamano wrote:
> Linus Torvalds <torvalds@osdl.org> writes:
>
> > Btw, Junio, I thought "git pull" was only supposed to do rename
> > detection, not copy detection.
>
> Sorry, but what do you mean by "only rename detection but not
> copy detection" in this case?
>
> When you have "ce A B; ce A C; ce A D;... ; mv A Z", (ce is like
> cp but "copy+edit") where B-Z are all new files and A disappears
> from the result, trying to detect renames would end up detecting
> copies without extra processing; B through Z are rename
> destination candidates, and A is a rename source candidate
> (there may be others), and it turns out that B-Z all look like
> A.
>
> Would it be easier to read if we say A was renamed to B, and A
> was renamed to C, and A was renamed to D, ...? I think the
> current output is easier to understand than that. B-Y gets
> labelled as copy of A and Z gets labelled as rename.
I think it's more confusing for the system to report Z differently from
other things, because there's nothing special about what it found, except
that Z happens to be last. I think it would be easiest to read as:
Rename A =>
B (80%)
C (85%)
D (75%)
...
Z (90%)
(Although I don't know if the results come out of the system sorted that
way; obviously, if there are different removed things, mixing them
together would be ambiguous in this format)
-Daniel
*This .sig left intentionally blank*
^ permalink raw reply
* Re: hgmq vs. StGIT
From: Catalin Marinas @ 2005-11-01 21:30 UTC (permalink / raw)
To: Chris Mason
Cc: Chuck Lever, Petr Baudis, Theodore Ts'o, Joel Becker,
Junio C Hamano, git
In-Reply-To: <20051101181352.GD26847@watt.suse.com>
On 01/11/05, Chris Mason <mason@suse.com> wrote:
> I would suggest just putting the .git/patches directory under revision
> control.
Putting them under a separate revisions repository, i.e. having a
.git/patches/,git directory? Otherwise there would be some problems
with the modified files automatically included in a patch.
> More importantly, you can reuse gitk and all of the other history
> functionality in the SCM.
Doing it the above way wouldn't be of much help with gitk. You would
get files like .git/patches/master/patchX/top etc. under revision
control which only contain some hash strings, not meaningful. With GIT
you have the advantage of being able to specify the DAG structure. It
is pretty simple to just link the commit objects corresponding to a
patch into a DAG and using gitk would allow you to navigate through
the history and also look at the diff itself.
--
Catalin
^ permalink raw reply
* Re: hgmq vs. StGIT
From: Catalin Marinas @ 2005-11-01 21:22 UTC (permalink / raw)
To: Chris Mason
Cc: Petr Baudis, Theodore Ts'o, Joel Becker, Junio C Hamano, git
In-Reply-To: <20051101175905.GC26847@watt.suse.com>
On 01/11/05, Chris Mason <mason@suse.com> wrote:
> The three way merge is still possible even if someone hand edits the
> patch. For a three way merge, you just need to know the parent revision
> of the change you want to merge. parent can mean the revision in the
> repository that precedes this patch (mq stores this information, just
> not in the patch), or it can mean any revision where the patch applies
> cleanly.
Yes, but what I meant is that someone may modify the patch in a way
that it is no longer appliable to its parent or to any other revision
in the tree. A this point, a three-way merge is no longer possible
(but, well, if someone modifies the patches this way should be able to
cope with the consequences).
> Both approaches (mq vs stgit) have advantages...you can get roughly the same
> functionality either way.
Yes, you are right. The big difference is the underlying tool (hg or git).
--
Catalin
^ permalink raw reply
* Re: [PATCH] Remove git-findtags.perl
From: Martin Langhoff @ 2005-11-01 21:15 UTC (permalink / raw)
To: Petr Baudis; +Cc: Junio C Hamano, git
In-Reply-To: <20051101202603.16900.9063.stgit@machine.or.cz>
On 11/2/05, Petr Baudis <pasky@suse.cz> wrote:
> This script was superseded by git-name-rev, which is more versatile,
> actually documented, faster, and everything else...
Definitely! I hadn't registered the addition of git-name-rev, but it
seems to be a much better solution.
cheers!
martin
^ permalink raw reply
* [PATCH] git-am.txt is no stub anymore
From: Petr Baudis @ 2005-11-01 20:47 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
That notice was added by me for the emergency documentation, but Junio
already expanded it to a full-fledged manual page. This patch removes
the notice.
Signed-off-by: Petr Baudis <pasky@suse.cz>
---
Documentation/git-am.txt | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
index 704dc51..e4df4a4 100644
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
@@ -82,8 +82,6 @@ Documentation
--------------
Documentation by Petr Baudis, Junio C Hamano and the git-list <git@vger.kernel.org>.
-This manual page is a stub. You can help the git documentation by expanding it.
-
GIT
---
Part of the gitlink:git[7] suite
^ permalink raw reply related
* [PATCH] Documentation for git-fmt-merge-msg
From: Petr Baudis @ 2005-11-01 20:45 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Simple description. It appears to be mostly internal command, but hey, it
is (it seems) the only undocumented one, so let's fix it up...
Also add a note about it to git-merge documentation.
Signed-off-by: Petr Baudis <pasky@suse.cz>
---
Documentation/git-fmt-merge-msg.txt | 39 +++++++++++++++++++++++++++++++++++
Documentation/git-merge.txt | 10 +++++++++
2 files changed, 49 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-fmt-merge-msg.txt b/Documentation/git-fmt-merge-msg.txt
new file mode 100644
index 0000000..a70eb39
--- /dev/null
+++ b/Documentation/git-fmt-merge-msg.txt
@@ -0,0 +1,39 @@
+git-fmt-merge-msg(1)
+====================
+
+NAME
+----
+git-fmt-merge-msg - Produce a merge commit message
+
+
+SYNOPSIS
+--------
+'git-fmt-merge-msg' <$GIT_DIR/FETCH_HEAD
+
+DESCRIPTION
+-----------
+Takes the list of merged objects on stdin and produces a suitable
+commit message to be used for the merge commit, usually to be
+passed as the '<merge-message>' argument of `git-merge`.
+
+This script is intended mostly for internal use by scripts
+automatically invoking `git-merge`.
+
+
+SEE ALSO
+--------
+gitlink:git-merge[1]
+
+
+Author
+------
+Written by Junio C Hamano <junkio@cox.net>
+
+Documentation
+--------------
+Documentation by Petr Baudis, Junio C Hamano and the git-list <git@vger.kernel.org>.
+
+GIT
+---
+Part of the gitlink:git[7] suite
+
diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt
index a007a8b..8c9c4d8 100644
--- a/Documentation/git-merge.txt
+++ b/Documentation/git-merge.txt
@@ -28,6 +28,11 @@ OPTIONS
there is no `-s` option, built-in list of strategies is
used instead.
+<msg>::
+ The commit message to be used for the merge commit (in case
+ it is created). The `git-fmt-merge-msg` script can be used
+ to give a good default for automated `git-merge` invocations.
+
<head>::
our branch head commit.
@@ -37,6 +42,11 @@ OPTIONS
obviously means you are trying an Octopus.
+SEE ALSO
+--------
+gitlink:git-fmt-merge-msg[1]
+
+
Author
------
Written by Junio C Hamano <junkio@cox.net>
^ permalink raw reply related
* [PATCH] Remove git-findtags.perl
From: Petr Baudis @ 2005-11-01 20:26 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
This script was superseded by git-name-rev, which is more versatile,
actually documented, faster, and everything else...
Signed-off-by: Petr Baudis <pasky@suse.cz>
---
Makefile | 2 +
git-findtags.perl | 94 -----------------------------------------------------
2 files changed, 1 insertions(+), 95 deletions(-)
diff --git a/Makefile b/Makefile
index 644b517..a2ba886 100644
--- a/Makefile
+++ b/Makefile
@@ -94,7 +94,7 @@ SCRIPT_SH = \
SCRIPT_PERL = \
git-archimport.perl git-cvsimport.perl git-relink.perl \
git-rename.perl git-shortlog.perl git-fmt-merge-msg.perl \
- git-findtags.perl git-svnimport.perl git-mv.perl
+ git-svnimport.perl git-mv.perl
SCRIPT_PYTHON = \
git-merge-recursive.py
diff --git a/git-findtags.perl b/git-findtags.perl
deleted file mode 100755
index 745affe..0000000
--- a/git-findtags.perl
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Copyright (c) 2005 Martin Langhoff
-#
-# Walk the tags and find if they match a commit
-# expects a SHA1 of a commit. Option -t enables
-# searching trees too.
-#
-
-use strict;
-use File::Basename;
-use File::Find;
-use Getopt::Std;
-
-my $git_dir = $ENV{GIT_DIR} || '.git';
-$git_dir =~ s|/$||; # chomp trailing slash
-
-# options
-our $opt_t;
-getopts("t") || usage();
-
-my @tagfiles = `find $git_dir/refs/tags -follow -type f`; # haystack
-my $target = shift @ARGV; # needle
-unless ($target) {
- usage();
-}
-
-# drive the processing from the find hook
-# slower, safer (?) than the find utility
-find( { wanted => \&process,
- no_chdir => 1,
- follow => 1,
- }, "$git_dir/refs/tags");
-
-
-sub process {
- my ($dev,$ino,$mode,$nlink,$uid,$gid);
-
- # process only regular files
- unless ((($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && -f _) {
- return 1; # ignored anyway
- }
-
- my $tagfile = $_;
- chomp $tagfile;
- my $tagname = substr($tagfile, length($git_dir.'/refs/tags/'));
-
- my $tagid = quickread($tagfile);
- chomp $tagid;
-
- # is it just a soft tag?
- if ($tagid eq $target) {
- print "$tagname\n";
- return 1; # done with this tag
- }
-
- # grab the first 2 lines (the whole tag could be large)
- my $tagobj = `git-cat-file tag $tagid | head -n2 `;
- if ($tagobj =~ m/^type commit$/m) { # only deal with commits
-
- if ($tagobj =~ m/^object $target$/m) { # match on the commit
- print "$tagname\n";
-
- } elsif ( $opt_t && # follow the commit
- $tagobj =~ m/^object (\S+)$/m) { # and try to match trees
- my $commitid = $1;
- my $commitobj = `git-cat-file commit $commitid | head -n1`;
- chomp $commitobj;
- $commitobj =~ m/^tree (\S+)$/;
- my $treeid = $1;
- if ($target eq $treeid) {
- print "$tagname\n";
- }
- }
- }
-}
-
-sub quickread {
- my $file = shift;
- local $/; # undef: slurp mode
- open FILE, "<$file"
- or die "Cannot open $file : $!";
- my $content = <FILE>;
- close FILE;
- return $content;
-}
-
-sub usage {
- print STDERR <<END;
-Usage: ${\basename $0} # find tags for a commit or tree
- [ -t ] <commit-or-tree-sha1>
-END
- exit(1);
-}
^ permalink raw reply related
* [PATCH] Remove 'Previously this command was known as ...' messages.
From: Jon Loeliger @ 2005-11-01 20:22 UTC (permalink / raw)
To: Git List
For a 1.0 release, there is no need to maintain the
historical "Previously this command was known as..."
information on the doc splash page. It is noise;
command names should stand on their own now.
Signed-off-by: Jon Loeliger <jdl@freescale.com>
---
Right?
Documentation/git.txt | 44
--------------------------------------------
1 files changed, 0 insertions(+), 44 deletions(-)
bae42f2f93bcd41b5a389c31beeb49face0f6512
diff --git a/Documentation/git.txt b/Documentation/git.txt
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -60,7 +60,6 @@ gitlink:git-apply[1]::
gitlink:git-checkout-index[1]::
Copy files from the cache to the working directory
- Previously this command was known as git-checkout-cache.
gitlink:git-commit-tree[1]::
Creates a new commit object
@@ -76,7 +75,6 @@ gitlink:git-init-db[1]::
gitlink:git-merge-index[1]::
Runs a merge for files needing merging
- Previously this command was known as git-merge-cache.
gitlink:git-mktag[1]::
Creates a tag object
@@ -95,7 +93,6 @@ gitlink:git-unpack-objects[1]::
gitlink:git-update-index[1]::
Modifies the index or directory cache
- Previously this command was known as git-update-cache.
gitlink:git-write-tree[1]::
Creates a tree from the current cache
@@ -109,7 +106,6 @@ gitlink:git-cat-file[1]::
gitlink:git-diff-index[1]::
Compares content and mode of blobs between the cache and repository
- Previously this command was known as git-diff-cache.
gitlink:git-diff-files[1]::
Compares files in the working tree and the cache
@@ -122,7 +118,6 @@ gitlink:git-diff-tree[1]::
gitlink:git-fsck-objects[1]::
Verifies the connectivity and validity of the objects in the database
- Previously this command was known as git-fsck-cache.
gitlink:git-ls-files[1]::
Information about files in the cache/working directory
@@ -170,11 +165,9 @@ gitlink:git-fetch-pack[1]::
gitlink:git-http-fetch[1]::
Downloads a remote git repository via HTTP
- Previously this command was known as git-http-pull.
gitlink:git-local-fetch[1]::
Duplicates another git repository on a local system
- Previously this command was known as git-local-pull.
gitlink:git-peek-remote[1]::
Lists references on a remote repository using upload-pack protocol.
@@ -190,11 +183,9 @@ gitlink:git-shell[1]::
gitlink:git-ssh-fetch[1]::
Pulls from a remote repository over ssh connection
- Previously this command was known as git-ssh-pull.
gitlink:git-ssh-upload[1]::
Helper "server-side" program used by git-ssh-fetch
- Previously this command was known as git-ssh-push.
gitlink:git-update-server-info[1]::
Updates auxiliary information on a dumb server to help
@@ -210,7 +201,6 @@ Porcelain-ish Commands
gitlink:git-add[1]::
Add paths to the index file.
- Previously this command was known as git-add-script.
gitlink:git-am[1]::
Apply patches from a mailbox, but cooler.
@@ -220,50 +210,39 @@ gitlink:git-applymbox[1]::
gitlink:git-bisect[1]::
Find the change that introduced a bug.
- Previously this command was known as git-bisect-script.
gitlink:git-branch[1]::
Create and Show branches.
- Previously this command was known as git-branch-script.
gitlink:git-checkout[1]::
Checkout and switch to a branch.
- Previously this command was known as git-checkout-script.
gitlink:git-cherry-pick[1]::
Cherry-pick the effect of an existing commit.
- Previously this command was known as git-cherry-pick-script.
gitlink:git-clone[1]::
Clones a repository into a new directory.
- Previously this command was known as git-clone-script.
gitlink:git-commit[1]::
Record changes to the repository.
- Previously this command was known as git-commit-script.
gitlink:git-diff[1]::
Show changes between commits, commit and working tree, etc.
- Previously this command was known as git-diff-script.
gitlink:git-fetch[1]::
Download from a remote repository via various protocols.
- Previously this command was known as git-fetch-script.
gitlink:git-format-patch[1]::
Prepare patches for e-mail submission.
- Previously this command was known as git-format-patch-script.
gitlink:git-grep[1]::
Print lines matching a pattern
gitlink:git-log[1]::
Shows commit logs.
- Previously this command was known as git-log-script.
gitlink:git-ls-remote[1]::
Shows references in a remote or local repository.
- Previously this command was known as git-ls-remote-script.
gitlink:git-merge[1]::
Grand unified merge driver.
@@ -273,39 +252,30 @@ gitlink:git-mv[1]::
gitlink:git-octopus[1]::
Merge more than two commits.
- Previously this command was known as git-octopus-script.
gitlink:git-pull[1]::
Fetch from and merge with a remote repository.
- Previously this command was known as git-pull-script.
gitlink:git-push[1]::
Update remote refs along with associated objects.
- Previously this command was known as git-push-script.
gitlink:git-rebase[1]::
Rebase local commits to new upstream head.
- Previously this command was known as git-rebase-script.
gitlink:git-rename[1]::
Rename files and directories.
- Previously this command was known as git-rename-script.
gitlink:git-repack[1]::
Pack unpacked objects in a repository.
- Previously this command was known as git-repack-script.
gitlink:git-reset[1]::
Reset current HEAD to the specified state.
- Previously this command was known as git-reset-script.
gitlink:git-resolve[1]::
Merge two commits.
- Previously this command was known as git-resolve-script.
gitlink:git-revert[1]::
Revert an existing commit.
- Previously this command was known as git-revert-script.
gitlink:git-shortlog[1]::
Summarizes 'git log' output.
@@ -315,11 +285,9 @@ gitlink:git-show-branch[1]::
gitlink:git-status[1]::
Shows the working tree status.
- Previously this command was known as git-status-script.
gitlink:git-verify-tag[1]::
Check the GPG signature of tag.
- Previously this command was known as git-verify-tag-script.
gitlink:git-whatchanged[1]::
Shows commit logs and differences they introduce.
@@ -334,41 +302,33 @@ gitlink:git-applypatch[1]::
gitlink:git-archimport[1]::
Import an arch repository into git.
- Previously this command was known as git-archimport-script.
gitlink:git-convert-objects[1]::
Converts old-style git repository
- Previously this command was known as git-convert-cache.
gitlink:git-cvsimport[1]::
Salvage your data out of another SCM people love to hate.
- Previously this command was known as git-cvsimport-script.
gitlink:git-merge-one-file[1]::
The standard helper program to use with "git-merge-index"
- Previously this command was known as git-merge-one-file-script.
gitlink:git-prune[1]::
Prunes all unreachable objects from the object database
- Previously this command was known as git-prune-script.
gitlink:git-relink[1]::
Hardlink common objects in local repositories.
- Previously this command was known as git-relink-script.
gitlink:git-svnimport[1]::
Import a SVN repository into git.
gitlink:git-sh-setup[1]::
Common git shell script setup code.
- Previously this command was known as git-sh-setup-script.
gitlink:git-symbolic-ref[1]::
Read and modify symbolic refs
gitlink:git-tag[1]::
An example script to create a tag object signed with GPG
- Previously this command was known as git-tag-script.
gitlink:git-update-ref[1]::
Update the object name stored in a ref safely.
@@ -384,7 +344,6 @@ gitlink:git-cherry[1]::
gitlink:git-count-objects[1]::
Count unpacked number of objects and their disk consumption.
- Previously this command was known as git-count-objects-script.
gitlink:git-daemon[1]::
A really simple server for git repositories.
@@ -403,18 +362,15 @@ gitlink:git-patch-id[1]::
gitlink:git-parse-remote[1]::
Routines to help parsing $GIT_DIR/remotes/
- Previously this command was known as git-parse-remote-script.
gitlink:git-request-pull[1]::
git-request-pull.
- Previously this command was known as git-request-pull-script.
gitlink:git-rev-parse[1]::
Pick out and massage parameters.
gitlink:git-send-email[1]::
Send patch e-mails out of "format-patch --mbox" output.
- Previously this command was known as git-send-email-script.
gitlink:git-symbolic-refs[1]::
Read and modify symbolic refs.
^ permalink raw reply
* Re: HTTP pushes
From: Daniel Barkalow @ 2005-11-01 20:06 UTC (permalink / raw)
To: Nick Hengeveld; +Cc: git
In-Reply-To: <20051101020248.GA3928@reactrix.com>
On Mon, 31 Oct 2005, Nick Hengeveld wrote:
> HTTP is currently listed as a read-only/unsupported method for doing
> pushes, is that due to inherent problems with HTTP or just because
> it hasn't been written yet?
You obviously need a bit more than HTTP, and I don't personally know DAV.
Also, I was writing things with all of the control on the receiving side,
which isn't going to be the case here. If you've got a suitable
environment for that sort of thing, I say go for it.
-Daniel
*This .sig left intentionally blank*
^ permalink raw reply
* [ANNOUNCE] (H)gct 0.3
From: Fredrik Kuivinen @ 2005-11-01 19:37 UTC (permalink / raw)
To: git
Hi,
Version 0.3 of (H)gct, a GUI enabled commit tool for Git and
Mercurial, has been released and can be downloaded from
http://www.cyd.liu.se/~freku045/gct/ct-0.3.tar.gz
Thanks to Vincent Danjean there are Debian packages available at
http://dept-info.labri.fr/~danjean/deb.html#commit-tool
Screen shots and a Git repository with a gitweb interface are
available at the project homepage, http://www.cyd.liu.se/~freku045/gct
The major changes compared to v0.2 are:
* File filter, show only file names which contain a specified string.
* Make ignoring files actually work.
* A new option, --one-shot, which makes (h)gct exit after the first
commit.
* Support for new versions of git.
* An Hg extension which makes hgct better integrated with Hg. See
README.HG for details.
- Fredrik
^ permalink raw reply
* Re: HTTP pushes
From: Johannes Schindelin @ 2005-11-01 19:10 UTC (permalink / raw)
To: Nick Hengeveld; +Cc: git
In-Reply-To: <20051101020248.GA3928@reactrix.com>
Hi,
On Mon, 31 Oct 2005, Nick Hengeveld wrote:
> HTTP is currently listed as a read-only/unsupported method for doing
> pushes, is that due to inherent problems with HTTP or just because
> it hasn't been written yet?
>
> I've built a working prototype of an HTTP push implementation using DAV.
I think this is useful. There are restrictive firewalls out there, which
only allow ports 80 and 443 to be connected to. Your work would fit in
right there.
BTW, if the push would be relatively big, it would be nice to support
pushing packs...
Ciao,
Dscho
^ 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