* Re: [PATCH/RFC 1/x] gitweb: Use git-diff-tree patch output for commitdiff
From: Marco Costalba @ 2006-08-25 17:32 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git, Junio C Hamano
In-Reply-To: <eck1em$p8b$1@sea.gmane.org>
> >> Empty patches (mode changes and pure renames and copying)
> >> are not written currently.
> >
> > That's quite bad.
>
> This can be easily changed. Question: what format? Current "gitweb diff
I don't know if has always been like this, but I don't see on gitweb
(http://www.kernel.org/git/?p=qgit/qgit.git;a=shortlog) the diff of
the patch I've just pushed.
The patch is "Fix correct permissions on this excutable script",
currently the HEAD of qgit repo. The content it's only a file mode
change in helpgen.sh, so it' an 'empty' patch.
I've done something wrong or it's gitweb that does not show this info?
Thanks
Marco
^ permalink raw reply
* git-svn problem: unexpected files/diffs in commit
From: Seth Falcon @ 2006-08-25 16:31 UTC (permalink / raw)
To: git
Hi,
I just made an svn commit using 'git-svn commit' and ended up with a
quite unexpected result.
I'm using svn, version 1.3.2 (r19776) _with_ the SVN:: lib and
git is git version 1.4.2.g7099c (actually, I just updated and so I was
a few commits back, but git-svn.perl didn't change, so I'm pretty
confident that I'm current w.r.t. git-svn).
Here is a copy/paste of my session (some edits since some history was lost):
## Check for changes in svn repos and merge them in.
ziti:~/proj/graph-git seth$ git-svn fetch
ziti:~/proj/graph-git seth$ git pull . remotes/git-svn
Trying really trivial in-index merge...
Wonderful.
In-index merge
DESCRIPTION | 2 +-
R/AllGenerics.R | 2 +-
R/clustergraph.R | 4 ++--
man/distGraph-class.Rd | 6 ++++--
4 files changed, 8 insertions(+), 6 deletions(-)
## I'm really where I think I am:
ziti:~/proj/graph-git seth$ git branch
* master
## Let's see what I _would_ commit if I did the normal git-svn commit
## thing
ziti:~/proj/graph-git seth$ git diff --stat remotes/git-svn..master
inst/unitTests/graphNEL_test.R | 2 +-
inst/unitTests/runalltests.R | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
## Yeah, that looks right.
## ok, go for the commit
ziti:~/proj/graph-git seth$ git-svn commit remotes/git-svn..master
diff-tree f5ebf17f7e460d3bc3de72ab381c72dc76d26936 0681f7614c342b85b91d909ff02a9a966a44c3f4
M DESCRIPTION
M R/AllGenerics.R
M R/clustergraph.R
M inst/unitTests/graphNEL_test.R
M inst/unitTests/runalltests.R
M man/distGraph-class.Rd
r19467 = 1b75d81a95da328f0b0d06b7562fdb48970b4c98
RA layer request failed: OPTIONS request failed on '/bioconductor': OPTIONS of '/bioconductor': Could not read status line: SSL error: decryption failed or bad record mac (https://hedgehog.fhcrc.org) at /Users/seth/scm/bin/git-svn line 526
65280 at /Users/seth/scm/bin/git-svn line 547
main::commit_lib('0681f7614c342b85b91d909ff02a9a966a44c3f4', '0cccf3753b472b52a93154ed8021499055bb3923') called at /Users/seth/scm/bin/git-svn line 457
main::commit('remotes/git-svn..master') called at /Users/seth/scm/bin/git-svn line 149
## GAAAHH! That isn't what I wanted at all. It looks as if I didn't
## really do the pull. What is going on?
Despite the SSL error, the commit to svn actually went through and I
had to back it out. Did I do something wrong? I did the git-svn
fetch and pull to sync up, then reapplied my patch and git-svn commit
"worked" although I got the same SSL error.
If I can provide more info, let me know.
Thanks,
^ permalink raw reply
* [PATCH/RFC] Add interpolated git-daemon virtualization support.
From: Jon Loeliger @ 2006-08-25 15:26 UTC (permalink / raw)
To: git
---
Junio,
Here are my patches for the git daemon virtualization after
I rewrote the interpolation code. I think there are still
issues with the path/directory specification mechanism, as
I end up with crufty inetd invocation:
git stream tcp nowait nobody /usr/bin/git-daemon git-daemon --inetd
--verbose --syslog
--export-all --interpolated-path=/pub/%H/%D
/pub/software /software
/pub/www.example.com/software
/pub/www.example.org/software
/pub
A natural suggestion here is to supply %PeerIP from the connection.
Feel free to extend, augment or make suggestions, of course.
Thanks,
jdl
Makefile | 4 ++
daemon.c | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
interpolate.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++
interpolate.h | 13 +++++++
4 files changed, 188 insertions(+), 13 deletions(-)
diff --git a/Makefile b/Makefile
index b15b420..2691a58 100644
--- a/Makefile
+++ b/Makefile
@@ -242,7 +242,9 @@ DIFF_OBJS = \
LIB_OBJS = \
blob.o commit.o connect.o csum-file.o cache-tree.o base85.o \
- date.o diff-delta.o entry.o exec_cmd.o ident.o lockfile.o \
+ date.o diff-delta.o entry.o exec_cmd.o ident.o \
+ interpolate.o \
+ lockfile.o \
object.o pack-check.o patch-delta.o path.o pkt-line.o \
quote.o read-cache.o refs.o run-command.o dir.o object-refs.o \
server-info.o setup.o sha1_file.o sha1_name.o strbuf.o \
diff --git a/daemon.c b/daemon.c
index 012936f..67a3646 100644
--- a/daemon.c
+++ b/daemon.c
@@ -10,6 +10,7 @@ #include <syslog.h>
#include "pkt-line.h"
#include "cache.h"
#include "exec_cmd.h"
+#include "interpolate.h"
static int log_syslog;
static int verbose;
@@ -18,7 +19,8 @@ static int reuseaddr;
static const char daemon_usage[] =
"git-daemon [--verbose] [--syslog] [--inetd | --port=n] [--export-all]\n"
" [--timeout=n] [--init-timeout=n] [--strict-paths]\n"
-" [--base-path=path] [--user-path | --user-path=path]\n"
+" [--base-path=path] [--interpolated-path=path]\n"
+" [--user-path | --user-path=path]\n"
" [--reuseaddr] [--detach] [--pid-file=file] [directory...]";
/* List of acceptable pathname prefixes */
@@ -30,6 +32,10 @@ static int export_all_trees;
/* Take all paths relative to this one if non-NULL */
static char *base_path;
+static char *interpolated_path;
+
+/* Flag indicating client sent extra args. */
+static int saw_extended_args;
/* If defined, ~user notation is allowed and the string is inserted
* after ~user/. E.g. a request to git://host/~alice/frotz would
@@ -41,6 +47,23 @@ static const char *user_path;
static unsigned int timeout;
static unsigned int init_timeout;
+/*
+ * Static table for now. Ugh.
+ * Feel free to make dynamic as needed.
+ */
+#define INTERP_SLOT_HOST (0)
+#define INTERP_SLOT_DIR (1)
+#define INTERP_SLOT_PERCENT (2)
+
+struct interp interp_table[] = {
+ { "%H", 0},
+ { "%D", 0},
+ { "%%", "%"},
+};
+
+#define N_INTERPS (sizeof(interp_table) / sizeof(struct interp))
+
+
static void logreport(int priority, const char *err, va_list params)
{
/* We should do a single write so that it is atomic and output
@@ -148,10 +171,15 @@ static int avoid_alias(char *p)
}
}
-static char *path_ok(char *dir)
+static char *path_ok(struct interp *itable)
{
static char rpath[PATH_MAX];
+ static char interp_path[PATH_MAX];
char *path;
+ char *dir;
+
+ dir = itable[INTERP_SLOT_DIR].value;
+ loginfo("Request for '%s'", dir);
if (avoid_alias(dir)) {
logerror("'%s': aliased", dir);
@@ -180,16 +208,34 @@ static char *path_ok(char *dir)
dir = rpath;
}
}
+ else if (interpolated_path && saw_extended_args) {
+ if (*dir != '/') {
+ /* Allow only absolute */
+ logerror("'%s': Non-absolute path denied (interpolated-path active)", dir);
+ return NULL;
+ }
+
+ loginfo("Before interpolation '%s'", dir);
+ loginfo("Interp slot 0 (%s,%s)",
+ interp_table[0].name, interp_table[0].value);
+ loginfo("Interp slot 1 (%s,%s)",
+ interp_table[1].name, interp_table[1].value);
+ interpolate(interp_path, PATH_MAX, interpolated_path,
+ interp_table, N_INTERPS);
+ loginfo("After interpolation '%s'", interp_path);
+ dir = interp_path;
+ }
else if (base_path) {
if (*dir != '/') {
/* Allow only absolute */
logerror("'%s': Non-absolute path denied (base-path active)", dir);
return NULL;
}
- else {
- snprintf(rpath, PATH_MAX, "%s%s", base_path, dir);
- dir = rpath;
- }
+ snprintf(rpath, PATH_MAX, "%s%s", base_path, dir);
+ loginfo("dir was %s", dir);
+ loginfo("base_path is %s", base_path);
+ loginfo("rpath now %s", rpath);
+ dir = rpath;
}
path = enter_repo(dir, strict_paths);
@@ -229,15 +275,13 @@ static char *path_ok(char *dir)
return NULL; /* Fallthrough. Deny by default */
}
-static int upload(char *dir)
+static int upload(struct interp *itable)
{
/* Timeout as string */
char timeout_buf[64];
const char *path;
- loginfo("Request for '%s'", dir);
-
- if (!(path = path_ok(dir)))
+ if (!(path = path_ok(itable)))
return -1;
/*
@@ -270,6 +314,29 @@ static int upload(char *dir)
return -1;
}
+void parse_extra_args(char *extra_args, int buflen)
+{
+ char *val;
+ int vallen;
+ char *end = extra_args + buflen;
+
+ while (extra_args < end && *extra_args) {
+ saw_extended_args = 1;
+ loginfo("Extended arg %s", extra_args);
+ if (strncasecmp("host=", extra_args, 5) == 0) {
+ val = extra_args + 5;
+ vallen = strlen(val) + 1;
+ if (*val) {
+ char *save = xmalloc(vallen);
+ interp_table[INTERP_SLOT_HOST].value = save;
+ strlcpy(save, val, vallen);
+ }
+ /* On to the next one */
+ extra_args = val + vallen;
+ }
+ }
+}
+
static int execute(struct sockaddr *addr)
{
static char line[1000];
@@ -310,8 +377,14 @@ #endif
if (len && line[len-1] == '\n')
line[--len] = 0;
- if (!strncmp("git-upload-pack ", line, 16))
- return upload(line+16);
+ if (len != pktlen) {
+ parse_extra_args(line + len + 1, pktlen - len - 1);
+ }
+
+ if (!strncmp("git-upload-pack ", line, 16)) {
+ interp_table[INTERP_SLOT_DIR].value = line+16;
+ return upload(interp_table);
+ }
logerror("Protocol error: '%s'", line);
return -1;
@@ -770,6 +843,10 @@ int main(int argc, char **argv)
base_path = arg+12;
continue;
}
+ if (!strncmp(arg, "--interpolated-path=", 20)) {
+ interpolated_path = arg+20;
+ continue;
+ }
if (!strcmp(arg, "--reuseaddr")) {
reuseaddr = 1;
continue;
diff --git a/interpolate.c b/interpolate.c
new file mode 100644
index 0000000..30fa7a1
--- /dev/null
+++ b/interpolate.c
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2006 Jon Loeliger
+ */
+
+#include <string.h>
+
+#include "interpolate.h"
+
+
+/*
+ * Convert a NUL-terminated string in buffer orig
+ * into the supplied buffer, result, whose length is reslen,
+ * performing substitutions on %-named sub-strings from
+ * the table, interps, with ninterps entries.
+ *
+ * Example interps:
+ * {
+ * { "%H", "example.org"},
+ * { "%port", "123"},
+ * { "%%", "%"},
+ * }
+ *
+ * Returns 1 on a successful substitution pass that fits in result,
+ * Returns 0 on a failed or overflowing substitution pass.
+ */
+
+int
+interpolate(char *result, int reslen,
+ char *orig,
+ struct interp *interps, int ninterps)
+{
+ char *src = orig;
+ char *dest = result;
+ int newlen = 0;
+ char *name, *value;
+ int namelen, valuelen;
+ int i;
+ char c;
+
+ bzero(result, reslen);
+
+ while ((c = *src) && newlen < reslen - 1) {
+ if (c == '%') {
+ /* Try to match an interpolation string. */
+ for (i = 0; i < ninterps; i++) {
+ name = interps[i].name;
+ namelen = strlen(name);
+ if (strncmp(src, name, namelen) == 0) {
+ break;
+ }
+ }
+
+ /* Check for valid interpolation. */
+ if (i < ninterps) {
+ value = interps[i].value;
+ valuelen = strlen(value);
+
+ if (newlen + valuelen < reslen - 1) {
+ /* Substitute. */
+ strncpy(dest, value, valuelen);
+ newlen += valuelen;
+ dest += valuelen;
+ src += namelen;
+ } else {
+ /* Something's not fitting. */
+ return 0;
+ }
+
+ } else {
+ /* Skip bogus interpolation. */
+ *dest++ = *src++;
+ newlen++;
+ }
+
+ } else {
+ /* Straight copy one non-interpolation character. */
+ *dest++ = *src++;
+ newlen++;
+ }
+ }
+
+ return newlen < reslen - 1;
+}
diff --git a/interpolate.h b/interpolate.h
new file mode 100644
index 0000000..241af7c
--- /dev/null
+++ b/interpolate.h
@@ -0,0 +1,13 @@
+/*
+ * Copyright 2006 Jon Loeliger
+ */
+
+struct interp {
+ char *name;
+ char *value;
+};
+
+extern int interpolate(char *result, int reslen,
+ char *orig,
+ struct interp *interps, int ninterps);
+
^ permalink raw reply related
* Re: Problem with pack
From: Sergio Callegari @ 2006-08-25 12:31 UTC (permalink / raw)
To: git
>
> Andreas Ericsson <ae@op5.se> writes:
>
> >> Btw, even without that, if I understand correctly, git packs are
> >> collections of compressed objects, each of which has its own header
> >> stating how long is the compressed object itself. In my case, the
> >> error is in inflating one object (git unpack-objects says inflate
> >> returns -3)... so shouldn't there be a way to try to skip to the
> >> next object even in this case?
> >
> > It should be possible, assuming the pack index is still intact. The
> > pack index is where the headers are stored, afaik.
>
> The problem Sergio seems to be having is because somehow he does
> not have a base object that another object that is in the pack
> depends on, because the latter object is stored in deltified
> form.
>
> This should never happen unless .pack itself is corrupted
> (git-pack-objects, unless explicitly told to do so with --thin
> flag to git-rev-list upstream, would not make a delta against
> objects not in the same pack).
>
> When a delta is written to the pack file, unless its base object
> has already written out, git-pack-objects writes out the base
> object immediately after that deltified object. So one
> possibility is that the pack was truncated soon after the delta
> that is having trouble with finding its base object. In such a
> case, the proposed recovery measure of skipping the corruption
> and keep going would not buy you that much. On the other hand,
> if the corruption is in the middle (e.g. a single disk block was
> wiped out), having .idx file might help you resync.
>
> Does the pack pass git-verify-pack test, I wonder?
If I try to verify the pack I get:
git verify-pack -v pack-ebcdfbbda07e5a3e4136aa1f499990b35685bab4.idx
fatal: failed to read delta-pack base object
2849bd2bd8a76bbca37df2a4c8e8b990811d01a7
the package length seems reasonable, however... (no evident sign of
truncation, but I haven't looked inside the index to check the exact
positions of objects)...
and git unpack-object dies with error code -3 in inflate...
If I am not wrong (but I might easily be so) this should not be relative
to truncation...
Sergio
^ permalink raw reply
* Re: Problem with pack
From: Junio C Hamano @ 2006-08-25 10:58 UTC (permalink / raw)
To: Andreas Ericsson; +Cc: git, Sergio Callegari
In-Reply-To: <44EECEDC.7090608@op5.se>
Andreas Ericsson <ae@op5.se> writes:
>> Btw, even without that, if I understand correctly, git packs are
>> collections of compressed objects, each of which has its own header
>> stating how long is the compressed object itself. In my case, the
>> error is in inflating one object (git unpack-objects says inflate
>> returns -3)... so shouldn't there be a way to try to skip to the
>> next object even in this case?
>
> It should be possible, assuming the pack index is still intact. The
> pack index is where the headers are stored, afaik.
The problem Sergio seems to be having is because somehow he does
not have a base object that another object that is in the pack
depends on, because the latter object is stored in deltified
form.
This should never happen unless .pack itself is corrupted
(git-pack-objects, unless explicitly told to do so with --thin
flag to git-rev-list upstream, would not make a delta against
objects not in the same pack).
When a delta is written to the pack file, unless its base object
has already written out, git-pack-objects writes out the base
object immediately after that deltified object. So one
possibility is that the pack was truncated soon after the delta
that is having trouble with finding its base object. In such a
case, the proposed recovery measure of skipping the corruption
and keep going would not buy you that much. On the other hand,
if the corruption is in the middle (e.g. a single disk block was
wiped out), having .idx file might help you resync.
Does the pack pass git-verify-pack test, I wonder?
^ permalink raw reply
* Re: Problem with pack
From: Jakub Narebski @ 2006-08-25 10:41 UTC (permalink / raw)
To: git
In-Reply-To: <44EECEDC.7090608@op5.se>
Andreas Ericsson wrote:
>>> BTW I'd recommend not syncing with unison, but with the git
>>> transports: If your PC and Laptop are connected, you could do
>>> something like
>>>
>>> git pull laptop:my_project/.git
>>>
>> Actually, the project, including the git archive gets syncronized as a
>> part of a syncronization process including all my Documents directory
>> (the project is in fact a LaTeX manual with somehow complex LaTeX
>> packages and classes). Syncronizing in this way actually worked very
>> well so far, because at once I was getting in sync all my working trees
>> and all my repos...
>>
>
> The largest benefit of using git's synchronization methods is that you
> immediately get a pack-file verification, and also that you never risk
> overwriting anything in either repo if you've forgotten to sync between
> the two (say you've made changes on your laptop, forgot to send them to
> your workstation, then made changes on your workstation and then you try
> to sync them). It's possible to recover from such a situation using the
> lost-found tool, but it can be cumbersome, and uncommitted changes, as
> well as changes to the working tree, are lost forever.
Unison (which if I remember correctly uses rsync, or rsync over ssh) detect
such case and ask user what to do if both sides changed a file (copy from
one side, copy from second side, view diff, merge,...).
But you can always tell unison to ignore git object database
ignore = Name .git
and perhaps also ignore working directories under git control
ignore = Path path/to/working/dir/
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: Problem with pack
From: Andreas Ericsson @ 2006-08-25 10:20 UTC (permalink / raw)
To: Sergio Callegari; +Cc: git
In-Reply-To: <44EECBE2.7090801@arces.unibo.it>
Sergio Callegari wrote:
>>
>> > git verify-pack -v pack-ebcdfbbda07e5a3e4136aa1f499990b35685bab4.idx
>> > fatal: failed to read delta-pack base object
>> 2849bd2bd8a76bbca37df2a4c8e8b990811d01a7
>>
>> Eeeh! Not good.
>>
>> > 1) I am working on both a pc and a notebook, syncing the two
>> everytime I move
>> > from one to the other.
>>
>> So, you still have one "good" version? Please make a backup
>> immediately. (If only to reproduce the problem.)
>>
> I have a good working tree, but unfortunately I realized that there was
> a problem with the pack only _after_ the sync:
> I was not expecting this kind of problem, so I silly did a repack as the
> last thing, I went home, I attached the laptop to the net, I run unison,
> I started to work and I realized that there was a problem when I
> attempted a new repack which failed complaining about the corrupted pack...
>
> So actually, I do not even know where the corruption came from (an hd
> error, the sync tool, ...)
>
> I only have the corrupted pack and its index and a good last working tree.
>
> BTW, it would be nice to have some "security measure" in git reset...
> e.g. an option to trigger the following behavior:
>
> - saving all current changes in a temporary commit
> - checking that the current HEAD can be re-checked out before the reset
>
The recommended way is to do a throw-away branch to commit your
temporary commit to (or the 'master' so long as you remember to use
reset). The current HEAD can always, barring object database errors, be
checked out if 'git status' reports no changes in the working tree.
Unfortunately, the object database is often enormous, so doing a full
fsck-objects before each change to the branch you're on (which is
basically what a reset is), would take far too long to be viable.
>> Since unpack-objects does not use the index, it cannot extract
>> anything after the first error. We _could_ enhance unpack-objects to
>> be nice and optionally take a pack-index to try to reconstruct as many
>> objects as possible.
>>
> That would be very useful...
> Btw, even without that, if I understand correctly, git packs are
> collections of compressed objects, each of which has its own header
> stating how long is the compressed object itself. In my case, the error
> is in inflating one object (git unpack-objects says inflate returns
> -3)... so shouldn't there be a way to try to skip to the next object
> even in this case?
It should be possible, assuming the pack index is still intact. The pack
index is where the headers are stored, afaik.
>> BTW I'd recommend not syncing with unison, but with the git
>> transports: If your PC and Laptop are connected, you could do
>> something like
>>
>> git pull laptop:my_project/.git
>>
> Actually, the project, including the git archive gets syncronized as a
> part of a syncronization process including all my Documents directory
> (the project is in fact a LaTeX manual with somehow complex LaTeX
> packages and classes). Syncronizing in this way actually worked very
> well so far, because at once I was getting in sync all my working trees
> and all my repos...
>
The largest benefit of using git's synchronization methods is that you
immediately get a pack-file verification, and also that you never risk
overwriting anything in either repo if you've forgotten to sync between
the two (say you've made changes on your laptop, forgot to send them to
your workstation, then made changes on your workstation and then you try
to sync them). It's possible to recover from such a situation using the
lost-found tool, but it can be cumbersome, and uncommitted changes, as
well as changes to the working tree, are lost forever.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
^ permalink raw reply
* Re: Problem with pack
From: Sergio Callegari @ 2006-08-25 10:07 UTC (permalink / raw)
To: git
>
> > git verify-pack -v pack-ebcdfbbda07e5a3e4136aa1f499990b35685bab4.idx
> > fatal: failed to read delta-pack base object 2849bd2bd8a76bbca37df2a4c8e8b990811d01a7
>
> Eeeh! Not good.
>
> > 1) I am working on both a pc and a notebook, syncing the two everytime I move
> > from one to the other.
>
> So, you still have one "good" version? Please make a backup immediately.
> (If only to reproduce the problem.)
>
I have a good working tree, but unfortunately I realized that there was
a problem with the pack only _after_ the sync:
I was not expecting this kind of problem, so I silly did a repack as the
last thing, I went home, I attached the laptop to the net, I run unison,
I started to work and I realized that there was a problem when I
attempted a new repack which failed complaining about the corrupted pack...
So actually, I do not even know where the corruption came from (an hd
error, the sync tool, ...)
I only have the corrupted pack and its index and a good last working tree.
BTW, it would be nice to have some "security measure" in git reset...
e.g. an option to trigger the following behavior:
- saving all current changes in a temporary commit
- checking that the current HEAD can be re-checked out before the reset
> Since unpack-objects does not use the index, it cannot extract anything
> after the first error. We _could_ enhance unpack-objects to be nice and
> optionally take a pack-index to try to reconstruct as many objects as
> possible.
>
That would be very useful...
Btw, even without that, if I understand correctly, git packs are
collections of compressed objects, each of which has its own header
stating how long is the compressed object itself. In my case, the error
is in inflating one object (git unpack-objects says inflate returns
-3)... so shouldn't there be a way to try to skip to the next object
even in this case?
> BTW I'd recommend not syncing with unison, but with the git transports: If
> your PC and Laptop are connected, you could do something like
>
> git pull laptop:my_project/.git
>
Actually, the project, including the git archive gets syncronized as a
part of a syncronization process including all my Documents directory
(the project is in fact a LaTeX manual with somehow complex LaTeX
packages and classes). Syncronizing in this way actually worked very
well so far, because at once I was getting in sync all my working trees
and all my repos...
Sergio
^ permalink raw reply
* Re: Problem with pack
From: Johannes Schindelin @ 2006-08-25 9:12 UTC (permalink / raw)
To: Sergio Callegari; +Cc: git
In-Reply-To: <44EEB8AD.5080703@arces.unibo.it>
Hi,
On Fri, 25 Aug 2006, Sergio Callegari wrote:
> git verify-pack -v pack-ebcdfbbda07e5a3e4136aa1f499990b35685bab4.idx
> fatal: failed to read delta-pack base object 2849bd2bd8a76bbca37df2a4c8e8b990811d01a7
Eeeh! Not good.
> 1) I am working on both a pc and a notebook, syncing the two everytime I move
> from one to the other.
So, you still have one "good" version? Please make a backup immediately.
(If only to reproduce the problem.)
> On the PC I have git 1.4.2, on the notebook git 1.4.0. I am using "unison" as
> a syncing tool.
> Might the data loss have something to do with...
> - the version of git I am using or the mixing of two versions?
We tried very hard to maintain backward compatibility. So, it should be
fine.
> - the syncing? I have noticed that after a sync, git is not immediately in a
> happy state...
That is okay. The "index" (remember, git has a staging area called
"index") stores ctimes and mtimes, and these are not synced.
> 2) git unpack-objects seems to be able to extract some objects from the pack,
> but at a certain point it dies.
> - does it die on the first error or does it try to extract everything that is
> possible to extract after the error?
Since unpack-objects does not use the index, it cannot extract anything
after the first error. We _could_ enhance unpack-objects to be nice and
optionally take a pack-index to try to reconstruct as many objects as
possible.
BTW I'd recommend not syncing with unison, but with the git transports: If
your PC and Laptop are connected, you could do something like
git pull laptop:my_project/.git
(Of course, you have to adjust it for your setup.) This would sync your
repository on the PC with the one on the laptop.
Hth,
Dscho
^ permalink raw reply
* Problem with pack
From: Sergio Callegari @ 2006-08-25 8:45 UTC (permalink / raw)
To: git
Hi,
I am encountering a problem after a
git repack -a -d
on an archive.
The packet that has been generated appears to be corrupted:
git verify-pack -v pack-ebcdfbbda07e5a3e4136aa1f499990b35685bab4.idx
fatal: failed to read delta-pack base object
2849bd2bd8a76bbca37df2a4c8e8b990811d01a7
and apparently I might have lost all the history of my project.
I have a few questions:
1) I am working on both a pc and a notebook, syncing the two everytime I
move from one to the other.
On the PC I have git 1.4.2, on the notebook git 1.4.0. I am using
"unison" as a syncing tool.
Might the data loss have something to do with...
- the version of git I am using or the mixing of two versions?
- the syncing? I have noticed that after a sync, git is not immediately
in a happy state... for instance if I run
git diff
git lists diff commands for every file, even if those have not changed.
However after a
git status
everything seems fine again.
2) git unpack-objects seems to be able to extract some objects from the
pack, but at a certain point it dies.
- does it die on the first error or does it try to extract everything
that is possible to extract after the error?
- if it's the first, is there a way to trigger the second behaviour to
try to save as much as possible from the pack?
Thanks,
Sergio Callegari
^ permalink raw reply
* Re: Running gitweb under mod_perl
From: Randal L. Schwartz @ 2006-08-25 1:13 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <ecl3v4$s14$1@sea.gmane.org>
>>>>> "Jakub" == Jakub Narebski <jnareb@gmail.com> writes:
Jakub> Is there any way to check at _runtime_ if script is run under mod_perl,
Jakub> or would it be simplier (after script reorganization) for install time
Jakub> selection of using CGI, FastCGI, or Apache2::something...?
Yeah, look at the first few dozen lines of CGI.pm - it has to do different
things based on whether it's being run under mod_perl.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
^ permalink raw reply
* [PATCH 7/7] git-svn(1): improve asciidoc markup
From: Jonas Fonseca @ 2006-08-25 1:07 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <20060825010650.GG4069@diku.dk>
Use list continuation to have better wrapping. This accounts for most of
the changes because it reindents a lot of text without applying other
changes.
Use cross-referencing for interlinking and the gitlink macro for pointing
to other tools in the git suite.
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
Documentation/git-svn.txt | 199 ++++++++++++++++++++++++++-------------------
1 files changed, 114 insertions(+), 85 deletions(-)
diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 7d86809..f21aced 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -12,10 +12,8 @@ SYNOPSIS
DESCRIPTION
-----------
git-svn is a simple conduit for changesets between a single Subversion
-branch and git.
-
-git-svn is not to be confused with git-svnimport. The were designed
-with very different goals in mind.
+branch and git. It is not to be confused with gitlink:git-svnimport[1].
+They were designed with very different goals in mind.
git-svn is designed for an individual developer who wants a
bidirectional flow of changesets between a single branch in Subversion
@@ -34,26 +32,29 @@ git-svnimport is designed for.
COMMANDS
--------
-init::
+--
+
+'init'::
Creates an empty git repository with additional metadata
directories for git-svn. The Subversion URL must be specified
as a command-line argument.
-fetch::
- Fetch unfetched revisions from the Subversion URL we are
- tracking. refs/remotes/git-svn will be updated to the
- latest revision.
+'fetch'::
- Note: You should never attempt to modify the remotes/git-svn
- branch outside of git-svn. Instead, create a branch from
- remotes/git-svn and work on that branch. Use the 'commit'
- command (see below) to write git commits back to
- remotes/git-svn.
+Fetch unfetched revisions from the Subversion URL we are
+tracking. refs/remotes/git-svn will be updated to the
+latest revision.
- See 'Additional Fetch Arguments' if you are interested in
- manually joining branches on commit.
+Note: You should never attempt to modify the remotes/git-svn
+branch outside of git-svn. Instead, create a branch from
+remotes/git-svn and work on that branch. Use the 'commit'
+command (see below) to write git commits back to
+remotes/git-svn.
-commit::
+See '<<fetch-args,Additional Fetch Arguments>>' if you are interested in
+manually joining branches on commit.
+
+'commit'::
Commit specified commit or tree objects to SVN. This relies on
your imported fetch data being up-to-date. This makes
absolutely no attempts to do patching when committing to SVN, it
@@ -61,9 +62,9 @@ commit::
commit. All merging is assumed to have taken place
independently of git-svn functions.
-rebuild::
+'rebuild'::
Not a part of daily usage, but this is a useful command if
- you've just cloned a repository (using git-clone) that was
+ you've just cloned a repository (using gitlink:git-clone[1]) that was
tracked with git-svn. Unfortunately, git-clone does not clone
git-svn metadata and the svn working tree that git-svn uses for
its operations. This rebuilds the metadata so git-svn can
@@ -71,130 +72,152 @@ rebuild::
specified at the command-line if the directory/repository you're
tracking has moved or changed protocols.
-show-ignore::
+'show-ignore'::
Recursively finds and lists the svn:ignore property on
directories. The output is suitable for appending to
the $GIT_DIR/info/exclude file.
+--
+
OPTIONS
-------
+--
+
-r <ARG>::
--revision <ARG>::
- Only used with the 'fetch' command.
- Takes any valid -r<argument> svn would accept and passes it
- directly to svn. -r<ARG1>:<ARG2> ranges and "{" DATE "}" syntax
- is also supported. This is passed directly to svn, see svn
- documentation for more details.
+Only used with the 'fetch' command.
- This can allow you to make partial mirrors when running fetch.
+Takes any valid -r<argument> svn would accept and passes it
+directly to svn. -r<ARG1>:<ARG2> ranges and "{" DATE "}" syntax
+is also supported. This is passed directly to svn, see svn
+documentation for more details.
+
+This can allow you to make partial mirrors when running fetch.
-::
--stdin::
- Only used with the 'commit' command.
- Read a list of commits from stdin and commit them in reverse
- order. Only the leading sha1 is read from each line, so
- git-rev-list --pretty=oneline output can be used.
+Only used with the 'commit' command.
+
+Read a list of commits from stdin and commit them in reverse
+order. Only the leading sha1 is read from each line, so
+git-rev-list --pretty=oneline output can be used.
--rmdir::
- Only used with the 'commit' command.
- Remove directories from the SVN tree if there are no files left
- behind. SVN can version empty directories, and they are not
- removed by default if there are no files left in them. git
- cannot version empty directories. Enabling this flag will make
- the commit to SVN act like git.
+Only used with the 'commit' command.
- repo-config key: svn.rmdir
+Remove directories from the SVN tree if there are no files left
+behind. SVN can version empty directories, and they are not
+removed by default if there are no files left in them. git
+cannot version empty directories. Enabling this flag will make
+the commit to SVN act like git.
+
+repo-config key: svn.rmdir
-e::
--edit::
- Only used with the 'commit' command.
- Edit the commit message before committing to SVN. This is off by
- default for objects that are commits, and forced on when committing
- tree objects.
+Only used with the 'commit' command.
+
+Edit the commit message before committing to SVN. This is off by
+default for objects that are commits, and forced on when committing
+tree objects.
- repo-config key: svn.edit
+repo-config key: svn.edit
-l<num>::
--find-copies-harder::
- Both of these are only used with the 'commit' command.
- They are both passed directly to git-diff-tree see
- git-diff-tree(1) for more information.
+Both of these are only used with the 'commit' command.
- repo-config key: svn.l
- repo-config key: svn.findcopiesharder
+They are both passed directly to git-diff-tree see
+gitlink:git-diff-tree[1] for more information.
+
+[verse]
+repo-config key: svn.l
+repo-config key: svn.findcopiesharder
-A<filename>::
--authors-file=<filename>::
- Syntax is compatible with the files used by git-svnimport and
- git-cvsimport:
+Syntax is compatible with the files used by git-svnimport and
+git-cvsimport:
------------------------------------------------------------------------
-loginname = Joe User <user@example.com>
+ loginname = Joe User <user@example.com>
------------------------------------------------------------------------
- If this option is specified and git-svn encounters an SVN
- committer name that does not exist in the authors-file, git-svn
- will abort operation. The user will then have to add the
- appropriate entry. Re-running the previous git-svn command
- after the authors-file is modified should continue operation.
+If this option is specified and git-svn encounters an SVN
+committer name that does not exist in the authors-file, git-svn
+will abort operation. The user will then have to add the
+appropriate entry. Re-running the previous git-svn command
+after the authors-file is modified should continue operation.
+
+repo-config key: svn.authors-file
- repo-config key: svn.authors-file
+--
ADVANCED OPTIONS
----------------
+--
+
-b<refname>::
--branch <refname>::
- Used with 'fetch' or 'commit'.
+Used with 'fetch' or 'commit'.
- This can be used to join arbitrary git branches to remotes/git-svn
- on new commits where the tree object is equivalent.
+This can be used to join arbitrary git branches to remotes/git-svn
+on new commits where the tree object is equivalent.
- When used with different GIT_SVN_ID values, tags and branches in
- SVN can be tracked this way, as can some merges where the heads
- end up having completely equivalent content. This can even be
- used to track branches across multiple SVN _repositories_.
+When used with different GIT_SVN_ID values, tags and branches in
+SVN can be tracked this way, as can some merges where the heads
+end up having completely equivalent content. This can even be
+used to track branches across multiple SVN _repositories_.
- This option may be specified multiple times, once for each
- branch.
+This option may be specified multiple times, once for each
+branch.
- repo-config key: svn.branch
+repo-config key: svn.branch
-i<GIT_SVN_ID>::
--id <GIT_SVN_ID>::
- This sets GIT_SVN_ID (instead of using the environment). See
- the section on "Tracking Multiple Repositories or Branches" for
- more information on using GIT_SVN_ID.
+
+This sets GIT_SVN_ID (instead of using the environment). See the
+section on
+'<<tracking-multiple-repos,Tracking Multiple Repositories or Branches>>'
+for more information on using GIT_SVN_ID.
+
+--
COMPATIBILITY OPTIONS
---------------------
+--
+
--upgrade::
- Only used with the 'rebuild' command.
+Only used with the 'rebuild' command.
- Run this if you used an old version of git-svn that used
- "git-svn-HEAD" instead of "remotes/git-svn" as the branch
- for tracking the remote.
+Run this if you used an old version of git-svn that used
+"git-svn-HEAD" instead of "remotes/git-svn" as the branch
+for tracking the remote.
--no-ignore-externals::
- Only used with the 'fetch' and 'rebuild' command.
+Only used with the 'fetch' and 'rebuild' command.
+
+By default, git-svn passes --ignore-externals to svn to avoid
+fetching svn:external trees into git. Pass this flag to enable
+externals tracking directly via git.
- By default, git-svn passes --ignore-externals to svn to avoid
- fetching svn:external trees into git. Pass this flag to enable
- externals tracking directly via git.
+Versions of svn that do not support --ignore-externals are
+automatically detected and this flag will be automatically
+enabled for them.
- Versions of svn that do not support --ignore-externals are
- automatically detected and this flag will be automatically
- enabled for them.
+Otherwise, do not enable this flag unless you know what you're
+doing.
- Otherwise, do not enable this flag unless you know what you're
- doing.
+repo-config key: svn.noignoreexternals
- repo-config key: svn.noignoreexternals
+--
Basic Examples
~~~~~~~~~~~~~~
@@ -226,6 +249,7 @@ any automated merge/branch tracking on t
entirely up to the user on the git side. It's simply not worth it to do
a useful translation when the original signal is weak.
+[[tracking-multiple-repos]]
TRACKING MULTIPLE REPOSITORIES OR BRANCHES
------------------------------------------
This is for advanced users, most users should ignore this section.
@@ -241,6 +265,7 @@ invocation. The interface branch will b
remotes/git-svn. Any remotes/$GIT_SVN_ID branch should never be modified
by the user outside of git-svn commands.
+[[fetch-args]]
ADDITIONAL FETCH ARGUMENTS
--------------------------
This is for advanced users, most users should ignore this section.
@@ -251,11 +276,15 @@ optionally be specified in the form of s
command-line. Unfetched SVN revisions may also be tied to particular
git commits with the following syntax:
+------------------------------------------------
svn_revision_number=git_commit_sha1
+------------------------------------------------
-This allows you to tie unfetched SVN revision 375 to your current HEAD::
+This allows you to tie unfetched SVN revision 375 to your current HEAD:
- `git-svn fetch 375=$(git-rev-parse HEAD)`
+------------------------------------------------
+ git-svn fetch 375=$(git-rev-parse HEAD)
+------------------------------------------------
Advanced Example: Tracking a Reorganized Repository
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
1.4.2.GIT
--
Jonas Fonseca
^ permalink raw reply related
* [PATCH 6/7] gitview.txt: improve asciidoc markup
From: Jonas Fonseca @ 2006-08-25 1:06 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <20060825010548.GF4069@diku.dk>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
contrib/gitview/gitview.txt | 56 +++++++++++++++++++++++++------------------
1 files changed, 33 insertions(+), 23 deletions(-)
diff --git a/contrib/gitview/gitview.txt b/contrib/gitview/gitview.txt
index 6924df2..77c29de 100644
--- a/contrib/gitview/gitview.txt
+++ b/contrib/gitview/gitview.txt
@@ -7,40 +7,50 @@ gitview - A GTK based repository browser
SYNOPSIS
--------
-'gitview' [options] [args]
+'gitview' [options] [args]
DESCRIPTION
---------
-Dependencies
+Dependencies:
* Python 2.4
* PyGTK 2.8 or later
* PyCairo 1.0 or later
OPTIONS
-------
- --without-diff
- If the user doesn't want to list the commit diffs in the main window. This may speed up the repository browsing.
-
- <args>
- All the valid option for git-rev-list(1)
- Key Bindings:
- F4:
- To maximize the window
- F5:
- To reread references.
- F11:
- Full screen
- F12:
- Leave full screen
+-------
+--without-diff::
+
+ If the user doesn't want to list the commit diffs in the main window.
+ This may speed up the repository browsing.
+
+<args>::
+
+ All the valid option for gitlink:git-rev-list[1].
+
+Key Bindings
+------------
+F4::
+ To maximize the window
+
+F5::
+ To reread references.
+
+F11::
+ Full screen
+
+F12::
+ Leave full screen
EXAMPLES
-------
- gitview v2.6.12.. include/scsi drivers/scsi
- Show as the changes since version v2.6.12 that changed any file in the include/scsi
- or drivers/scsi subdirectories
+--------
+
+gitview v2.6.12.. include/scsi drivers/scsi::
+
+ Show as the changes since version v2.6.12 that changed any file in the
+ include/scsi or drivers/scsi subdirectories
- gitview --since=2.weeks.ago
- Show the changes during the last two weeks
+gitview --since=2.weeks.ago::
+ Show the changes during the last two weeks
--
1.4.2.GIT
--
Jonas Fonseca
^ permalink raw reply related
* [PATCH 5/7] git(7): put the synopsis in a verse style paragraph
From: Jonas Fonseca @ 2006-08-25 1:05 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <20060825010458.GE4069@diku.dk>
... so it wraps properly in small terminals.
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
Documentation/git.txt | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 3de5fa9..a9c87e3 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -8,8 +8,9 @@ git - the stupid content tracker
SYNOPSIS
--------
+[verse]
'git' [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate]
- [--bare] [--git-dir=GIT_DIR] [--help] COMMAND [ARGS]
+ [--bare] [--git-dir=GIT_DIR] [--help] COMMAND [ARGS]
DESCRIPTION
-----------
--
1.4.2.GIT
--
Jonas Fonseca
^ permalink raw reply related
* [PATCH 4/7] gitk(1): expand the manpage to look less like a template
From: Jonas Fonseca @ 2006-08-25 1:04 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <20060825010149.GD4069@diku.dk>
Add a short description and document a few selected options additionally to
the different "entities" in the standard calling convention. Advertise
other git repository browsers. Lastly, climb Mount Ego.
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
Documentation/gitk.txt | 60 ++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 50 insertions(+), 10 deletions(-)
diff --git a/Documentation/gitk.txt b/Documentation/gitk.txt
index cb482bf..23be005 100644
--- a/Documentation/gitk.txt
+++ b/Documentation/gitk.txt
@@ -3,26 +3,52 @@ gitk(1)
NAME
----
-gitk - Some git command not yet documented.
-
+gitk - git repository browser
SYNOPSIS
--------
-'gitk' [ --option ] <args>...
+'gitk' [<option>...] [<revs>] [--] [<path>...]
DESCRIPTION
-----------
-Does something not yet documented.
+Displays changes in a repository or a selected set of commits. This includes
+visualizing the commit graph, showing information related to each commit, and
+the files in the trees of each revision.
+Historically, gitk was the first repository browser. It's written in tcl/tk
+and started off in a separate repository but was later merged into the main
+git repository.
OPTIONS
-------
---option::
- Some option not yet documented.
+To control which revisions to shown, the command takes options applicable to
+the gitlink:git-rev-list[1] command. This manual page describes only the most
+frequently used options.
+
+-n <number>, --max-count=<number>::
+
+ Limits the number of commits to show.
+
+--since=<date>::
+
+ Show commits more recent than a specific date.
+
+--until=<date>::
+
+ Show commits older than a specific date.
-<args>...::
- Some argument not yet documented.
+<revs>::
+ Limit the revisions to show. This can be either a single revision
+ meaning show from the given revision and back, or it can be a range in
+ the form "'<from>'..'<to>'" to show all revisions between '<from>' and
+ back to '<to>'. Note, more advanced revision selection can be applied.
+
+<path>::
+
+ Limit commits to the ones touching files in the given paths. Note, to
+ avoid ambiguity wrt. revision names use "--" to separate the paths
+ from any preceeding options.
Examples
--------
@@ -37,13 +63,27 @@ gitk --since="2 weeks ago" \-- gitk::
The "--" is necessary to avoid confusion with the *branch* named
'gitk'
+See Also
+--------
+'qgit(1)'::
+ A repository browser written in C++ using Qt.
+
+'gitview(1)'::
+ A repository browser written in Python using Gtk. It's based on
+ 'bzrk(1)' and distributed in the contrib area of the git repository.
+
+'tig(1)'::
+ A minimal repository browser and git tool output highlighter written
+ in C using Ncurses.
+
Author
------
-Written by Paul Mackerras <paulus@samba.org>
+Written by Paul Mackerras <paulus@samba.org>.
Documentation
--------------
-Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
+Documentation by Junio C Hamano, Jonas Fonseca, and the git-list
+<git@vger.kernel.org>.
GIT
---
--
1.4.2.GIT
--
Jonas Fonseca
^ permalink raw reply related
* [PATCH 3/7] git-blame(1): mention options in the synopsis and advertise pickaxe
From: Jonas Fonseca @ 2006-08-25 1:01 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <20060825005820.GC4069@diku.dk>
Inspired by the cvs annotate documentation improve and expand the man page
to also mention the limitations of file annotations. Since people coming
from the SVN/CVS world might first look here, also briefly advertise how
the pickaxe interface makes it easy to go beyond these limitation.
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
Documentation/git-blame.txt | 29 +++++++++++++++++++++++------
1 files changed, 23 insertions(+), 6 deletions(-)
The advertising might be a bit too much, as in not belonging there.
diff --git a/Documentation/git-blame.txt b/Documentation/git-blame.txt
index bfed945..e1f8944 100644
--- a/Documentation/git-blame.txt
+++ b/Documentation/git-blame.txt
@@ -3,21 +3,38 @@ git-blame(1)
NAME
----
-git-blame - Blame file lines on commits
+git-blame - Show what revision and author last modified each line of a file
SYNOPSIS
--------
-git-blame file [options] file [revision]
+'git-blame' [-c] [-l] [-t] [-S <revs-file>] [--] <file> [<rev>]
DESCRIPTION
-----------
-Annotates each line in the given file with information from the commit
-which introduced the line. Start annotation from the given revision.
+
+Annotates each line in the given file with information from the revision which
+last modified the line. Optionally, start annotating from the given revision.
+
+This report doesn't tell you anything about lines which have been deleted or
+replaced; you need to use a tool such as gitlink:git-diff[1] or the "pickaxe"
+interface briefly mentioned in the following paragraph.
+
+Apart from supporting file annotation, git also supports searching the
+development history for when a code snippet occured in a change. This makes it
+possible to track when a code snippet was added to a file, moved or copied
+between files, and eventually deleted or replaced. It works by searching for
+a text string in the diff. A small example:
+
+-----------------------------------------------------------------------------
+$ git log --pretty=oneline -S'blame_usage'
+5040f17eba15504bad66b14a645bddd9b015ebb7 blame -S <ancestry-file>
+ea4c7f9bf69e781dd0cd88d2bccb2bf5cc15c9a7 git-blame: Make the output
+-----------------------------------------------------------------------------
OPTIONS
-------
-c, --compatibility::
- Use the same output mode as git-annotate (Default: off).
+ Use the same output mode as gitlink:git-annotate[1] (Default: off).
-l, --long::
Show long rev (Default: off).
@@ -26,7 +43,7 @@ OPTIONS
Show raw timestamp (Default: off).
-S, --rev-file <revs-file>::
- Use revs from revs-file instead of calling git-rev-list.
+ Use revs from revs-file instead of calling gitlink:git-rev-list[1].
-h, --help::
Show help message.
--
1.4.2.GIT
--
Jonas Fonseca
^ permalink raw reply related
* [PATCH 2/7] git-ls-remote(1): document --upload-pack
From: Jonas Fonseca @ 2006-08-25 0:58 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <20060825005655.GB4069@diku.dk>
... and mention that '.' will list the local repo references.
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
Documentation/git-ls-remote.txt | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/Documentation/git-ls-remote.txt b/Documentation/git-ls-remote.txt
index ae4c1a2..c8a4c5a 100644
--- a/Documentation/git-ls-remote.txt
+++ b/Documentation/git-ls-remote.txt
@@ -3,16 +3,19 @@ git-ls-remote(1)
NAME
----
-git-ls-remote - Look at references other repository has
+git-ls-remote - List references in a remote repository
SYNOPSIS
--------
-'git-ls-remote' [--heads] [--tags] <repository> <refs>...
+[verse]
+'git-ls-remote' [--heads] [--tags] [-u <exec> | --upload-pack <exec>]
+ <repository> <refs>...
DESCRIPTION
-----------
-Displays the references other repository has.
+Displays references available in a remote repository along with the associated
+commit IDs.
OPTIONS
@@ -23,9 +26,16 @@ OPTIONS
both, references stored in refs/heads and refs/tags are
displayed.
+-u <exec>, --upload-pack=<exec>::
+ Specify the full path of gitlink:git-upload-pack[1] on the remote
+ host. This allows listing references from repositories accessed via
+ SSH and where the SSH deamon does not use the PATH configured by the
+ user. Also see the '--exec' option for gitlink:git-peek-remote[1].
+
<repository>::
Location of the repository. The shorthand defined in
- $GIT_DIR/branches/ can be used.
+ $GIT_DIR/branches/ can be used. Use "." (dot) to list references in
+ the local repository.
<refs>...::
When unspecified, all references, after filtering done
--
1.4.2.GIT
--
Jonas Fonseca
^ permalink raw reply related
* [PATCH 1/7] git-apply(1): document missing options and improve existing ones
From: Jonas Fonseca @ 2006-08-25 0:56 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7virkqbcq3.fsf@assigned-by-dhcp.cox.net>
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
Documentation/git-apply.txt | 45 ++++++++++++++++++++++++++++++++-----------
1 files changed, 33 insertions(+), 12 deletions(-)
Junio C Hamano <junkio@cox.net> wrote Fri, Aug 18, 2006:
> Jonas Fonseca <fonseca@diku.dk> writes:
> > [ On top of next if that matters. ]
>
> I'd appreciate if you can hold this off for a while;
> I'll be updating git-apply a bit further [...]
I don't know if it's been a while, but I see that some of the changes
you mentioned has migrated to 'next', so here's an updated patch plus
a few other documentation updates that I did in the train today.
Changes to the former patch includes adding --verbose description and
removing the part about subdirectories from the patch.
> > I'm not sure if I got the --exclude note right, which says that
> > running apply from a subdirectory automatically excludes files
> > outside the subdirectory.
>
> I was thinking about dropping the exclude altogether, actually.
It does sound a bit special and mostly suited for batch work.
diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt
index 11641a9..20e12ce 100644
--- a/Documentation/git-apply.txt
+++ b/Documentation/git-apply.txt
@@ -10,10 +10,10 @@ SYNOPSIS
--------
[verse]
'git-apply' [--stat] [--numstat] [--summary] [--check] [--index] [--apply]
- [--no-add] [--index-info] [--allow-binary-replacement]
- [--reverse] [--reject] [-z] [-pNUM]
- [-CNUM] [--whitespace=<nowarn|warn|error|error-all|strip>]
- [<patch>...]
+ [--no-add] [--index-info] [--allow-binary-replacement | --binary]
+ [-R | --reverse] [--reject] [-z] [-pNUM] [-CNUM] [--inaccurate-eof]
+ [--whitespace=<nowarn|warn|error|error-all|strip>] [--exclude=PATH]
+ [--cached] [--verbose] [<patch>...]
DESCRIPTION
-----------
@@ -56,6 +56,11 @@ OPTIONS
up-to-date, it is flagged as an error. This flag also
causes the index file to be updated.
+--cached::
+ Apply a patch without touching the working tree. Instead, take the
+ cached data, apply the patch, and store the result in the index,
+ without using the working tree. This implies '--index'.
+
--index-info::
Newer git-diff output has embedded 'index information'
for each blob to help identify the original version that
@@ -63,14 +68,14 @@ OPTIONS
the original version of the blob is available locally,
outputs information about them to the standard output.
---reverse::
+-R, --reverse::
Apply the patch in reverse.
--reject::
- For atomicity, `git apply` fails the whole patch and
+ For atomicity, gitlink:git-apply[1] by default fails the whole patch and
does not touch the working tree when some of the hunks
- do not apply by default. This option makes it apply
- parts of the patch that are applicable, and send the
+ do not apply. This option makes it apply
+ the parts of the patch that are applicable, and send the
rejected hunks to the standard output of the command.
-z::
@@ -91,8 +96,8 @@ OPTIONS
ever ignored.
--apply::
- If you use any of the options marked ``Turns off
- "apply"'' above, git-apply reads and outputs the
+ If you use any of the options marked "Turns off
+ 'apply'" above, gitlink:git-apply[1] reads and outputs the
information you asked without actually applying the
patch. Give this flag after those flags to also apply
the patch.
@@ -104,7 +109,7 @@ OPTIONS
the result with this option, which would apply the
deletion part but not addition part.
---allow-binary-replacement::
+--allow-binary-replacement, --binary::
When applying a patch, which is a git-enhanced patch
that was prepared to record the pre- and post-image object
name in full, and the path being patched exactly matches
@@ -115,13 +120,18 @@ OPTIONS
result. This allows binary files to be patched in a
very limited way.
+--exclude=<path-pattern>::
+ Don't apply changes to files matching the given path pattern. This can
+ be useful when importing patchsets, where you want to exclude certain
+ files or directories.
+
--whitespace=<option>::
When applying a patch, detect a new or modified line
that ends with trailing whitespaces (this includes a
line that solely consists of whitespaces). By default,
the command outputs warning messages and applies the
patch.
- When `git-apply` is used for statistics and not applying a
+ When gitlink:git-apply[1] is used for statistics and not applying a
patch, it defaults to `nowarn`.
You can use different `<option>` to control this
behavior:
@@ -135,6 +145,17 @@ OPTIONS
* `strip` outputs warnings for a few such errors, strips out the
trailing whitespaces and applies the patch.
+--inacurate-eof::
+ Under certain circumstances, some versions of diff do not correctly
+ detect a missing new-line at the end of the file. As a result, patches
+ created by such diff programs do not record incomplete lines
+ correctly. This option adds support for applying such patches by
+ working around this bug.
+
+--verbose::
+ Report progress to stderr. By default, only a message about the
+ current patch being applied will be printed. This option will cause
+ additional information to be reported.
Configuration
-------------
--
1.4.2.GIT
--
Jonas Fonseca
^ permalink raw reply related
* [PATCH] describe: fix off-by-one error in --abbrev=40 handling
From: Jonas Fonseca @ 2006-08-25 0:48 UTC (permalink / raw)
To: git
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
Possible stupid fix, but shouldn't one be able to say --abbrev=40 if only
once in a life time?
describe.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/describe.c b/describe.c
index 2b9301f..5dd8b2e 100644
--- a/describe.c
+++ b/describe.c
@@ -42,7 +42,7 @@ static void add_to_known_names(const cha
struct commit_name *name = xmalloc(sizeof(struct commit_name) + len);
name->commit = commit;
- name->prio = prio;
+ name->prio = prio;
memcpy(name->path, path, len);
idx = names;
if (idx >= allocs) {
@@ -154,7 +154,7 @@ int main(int argc, char **argv)
tags = 1;
else if (!strncmp(arg, "--abbrev=", 9)) {
abbrev = strtoul(arg + 9, NULL, 10);
- if (abbrev < MINIMUM_ABBREV || 40 <= abbrev)
+ if (abbrev < MINIMUM_ABBREV || 40 < abbrev)
abbrev = DEFAULT_ABBREV;
}
else
--
Jonas Fonseca
^ permalink raw reply related
* [PATCH] cg-commit: fix signed off handling
From: Jonas Fonseca @ 2006-08-25 0:27 UTC (permalink / raw)
To: git
Handle the sign off insertion before starting the CG: comment lines. Also,
fix typo in grepping for existing sign off lines.
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
The late calling of the add_signoff function has multiple problems,
since at that point comment lines has already been added and the sign
off line will end up in only one of the log message files.
cg-commit | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/cg-commit b/cg-commit
index 5cebd81..b0b5c34 100755
--- a/cg-commit
+++ b/cg-commit
@@ -406,12 +406,10 @@ # Always have at least one blank line, t
# the poor people whose text editor has no 'O' command.
[ "$written" ] || { tty -s && echo >>"$LOGMSG"; }
-add_signoff() {
- if [ "$signoff" ] && ! grep -q -i "signed-off-by: $signoff" $LOGMSG; then
- grep -q -i sign-off-by $LOGMSG || echo
- echo "Signed-off-by: $signoff"
- fi >> $LOGMSG
-}
+if [ "$signoff" ] && ! grep -q -i "signed-off-by: $signoff" $LOGMSG; then
+ grep -q -i signed-off-by $LOGMSG || echo
+ echo "Signed-off-by: $signoff"
+fi >> $LOGMSG
# CG: -----------------------------------------------------------------------
editor_comment_start commit
@@ -472,7 +470,6 @@ editor_msg_end
cp "$LOGMSG" "$LOGMSG2"
if tty -s; then
- add_signoff
if [ "$editor" ] && ! editor $commitalways commit c; then
rm "$LOGMSG" "$LOGMSG2"
[ "$review" ] && rm "$PATCH"
@@ -503,7 +500,6 @@ __END__
editor_parse_setif GIT_AUTHOR_DATE Date
else
cat >>"$LOGMSG2"
- add_signoff
fi
if [ ! "$review" ]; then
--
Jonas Fonseca
^ permalink raw reply related
* Re: [PATCH] cg-commit: Fix a typo that would inhibit running of post-commit script:
From: Jonas Fonseca @ 2006-08-25 0:20 UTC (permalink / raw)
To: Jim Meyering; +Cc: git
In-Reply-To: <8764giro6t.fsf@rho.meyering.net>
Jim Meyering <jim@meyering.net> wrote Thu, Aug 24, 2006:
> I tried cg-commit with a commit hook, but the hook never ran.
> The problem was a typo:
>
> Fix a typo that would inhibit running the post-commit script:
> s/commit-post/post-commit/.
If I remember correctly, historically, the commit-post existed before
the post-commit appeared. You can see that it is documented in the man
page so it is not a typo.
However, this should certainly be updated, but I think a better fix
would be to transitionally warn the user about the existence of the
commit-post hook before using it in favour of post-commit.
> diff --git a/cg-commit b/cg-commit
> index 9d3b1a1..82eea60 100755
> --- a/cg-commit
> +++ b/cg-commit
> @@ -604,15 +604,16 @@ if [ "$newhead" ]; then
> branchname="$(cat "$_git/branch-name")"
> fi
> [ -z "$branchname" ] && [ "$_git_head" != "master" ] && branchname="$_git_head"
> - if [ -x "$_git/hooks/post-commit" -a ! "$no_hooks" ]; then
> + post_commit="$_git/hooks/post-commit"
> + if [ -x "$post_commit" -a ! "$no_hooks" ]; then
> if [ "$(git-repo-config --bool cogito.hooks.commit.post.allmerged)" = "true" ]; then
> # We just hope that for the initial commit, the user didn't
> # manage to install the hook yet.
> for merged in $(git-rev-list $newhead ^$oldhead | tac); do
> - "$_git/hooks/post-commit" "$merged" "$branchname"
> + "$post_commit" "$merged" "$branchname"
> done
> else
> - "$_git/hooks/post-commit" "$newhead" "$branchname"
> + "$post_commit" "$newhead" "$branchname"
> fi
> fi
The patch looks more like a refactoring of a previous commit that did
the commit-post -> post-commit replacement.
--
Jonas Fonseca
^ permalink raw reply
* [PATCH] cg-commit: prefix the relative path to the message file
From: Jonas Fonseca @ 2006-08-25 0:06 UTC (permalink / raw)
To: Jim Meyering; +Cc: git
In-Reply-To: <87d5aru4px.fsf@rho.meyering.net>
Makes the -M switch work from a subdirectory.
Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
Jim Meyering <jim@meyering.net> wrote Wed, Aug 23, 2006:
> Hello,
Hi,
> I discovered that "cg-commit -M MSG-FILE ..." fails when run from
> a subdirectory, and when MSG-FILE is a relative file name.
> This is using cogito-0.17.3-2 from Debian/unstable, but the problem
> remains when using the latest cogito sources, pulled minutes ago.
The attached patch should fix this problem.
---
cg-commit | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cg-commit b/cg-commit
index 0cec58f..5cebd81 100755
--- a/cg-commit
+++ b/cg-commit
@@ -398,7 +398,7 @@ fi
if [ "$msgfile" ]; then
[ "$written" ] && echo >>"$LOGMSG"
- cat "$msgfile" >>"$LOGMSG" || exit 1
+ cat "$_git_relpath$msgfile" >>"$LOGMSG" || exit 1
written=1
fi
--
Jonas Fonseca
^ permalink raw reply related
* [PATCH 10 (amended)] gitweb: Add support for hash_parent_base parameter for blobdiffs
From: Jakub Narebski @ 2006-08-24 21:53 UTC (permalink / raw)
To: git
In-Reply-To: <200608240015.15071.jnareb@gmail.com>
Add support for hash_parent_base in input validation part and in
href() function. Add proper hash_parent_base to all calls to blobdiff
and blobdiff_plain action URLs. Use hash_parent_base as hash_base for
blobs of hash_parent.
To be used in future rewrite of git_blobdiff and git_blobdiff_plain.
While at it, move project before action in ordering CGI parameters in
href().
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
gitweb/gitweb.perl | 37 +++++++++++++++++++++++++++----------
1 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index b2e8259..a3553ad 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -211,6 +211,13 @@ if (defined $hash_base) {
}
}
+our $hash_parent_base = $cgi->param('hpb');
+if (defined $hash_parent_base) {
+ if (!validate_input($hash_parent_base)) {
+ die_error(undef, "Invalid hash parent base parameter");
+ }
+}
+
our $page = $cgi->param('pg');
if (defined $page) {
if ($page =~ m/[^0-9]$/) {
@@ -270,13 +277,14 @@ sub href(%) {
my %params = @_;
my @mapping = (
- action => "a",
project => "p",
+ action => "a",
file_name => "f",
file_parent => "fp",
hash => "h",
hash_parent => "hp",
hash_base => "hb",
+ hash_parent_base => "hpb",
page => "pg",
searchtext => "s",
);
@@ -1543,8 +1551,10 @@ sub git_difftree_body {
}
print "<td>";
if ($diff{'to_id'} ne $diff{'from_id'}) { # modified
- print $cgi->a({-href => href(action=>"blobdiff", hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},
- hash_base=>$hash, file_name=>$diff{'file'}),
+ print $cgi->a({-href => href(action=>"blobdiff",
+ hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},
+ hash_base=>$hash, hash_parent_base=>$parent,
+ file_name=>$diff{'file'}),
-class => "list"}, esc_html($diff{'file'}));
} else { # only mode changed
print $cgi->a({-href => href(action=>"blob", hash=>$diff{'to_id'},
@@ -1559,8 +1569,10 @@ sub git_difftree_body {
"blob");
if ($diff{'to_id'} ne $diff{'from_id'}) { # modified
print " | " .
- $cgi->a({-href => href(action=>"blobdiff", hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},
- hash_base=>$hash, file_name=>$diff{'file'})},
+ $cgi->a({-href => href(action=>"blobdiff",
+ hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},
+ hash_base=>$hash, hash_parent_base=>$parent,
+ file_name=>$diff{'file'})},
"diff");
}
print " | " .
@@ -1592,8 +1604,9 @@ sub git_difftree_body {
"blob");
if ($diff{'to_id'} ne $diff{'from_id'}) {
print " | " .
- $cgi->a({-href => href(action=>"blobdiff", hash_base=>$hash,
+ $cgi->a({-href => href(action=>"blobdiff",
hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},
+ hash_base=>$hash, hash_parent_base=>$parent,
file_name=>$diff{'to_file'}, file_parent=>$diff{'from_file'})},
"diff");
}
@@ -1793,8 +1806,10 @@ sub git_history_body {
if (defined $blob_current && defined $blob_parent &&
$blob_current ne $blob_parent) {
print " | " .
- $cgi->a({-href => href(action=>"blobdiff", hash=>$blob_current, hash_parent=>$blob_parent,
- hash_base=>$commit, file_name=>$file_name)},
+ $cgi->a({-href => href(action=>"blobdiff",
+ hash=>$blob_current, hash_parent=>$blob_parent,
+ hash_base=>$hash_base, hash_parent_base=>$commit,
+ file_name=>$file_name)},
"diff to current");
}
}
@@ -2751,7 +2766,9 @@ sub git_blobdiff {
if (defined $hash_base && (my %co = parse_commit($hash_base))) {
my $formats_nav =
$cgi->a({-href => href(action=>"blobdiff_plain",
- hash=>$hash, hash_parent=>$hash_parent)},
+ hash=>$hash, hash_parent=>$hash_parent,
+ hash_base=>$hash_base, hash_parent_base=>$hash_parent_base,
+ file_name=>$file_name, file_parent=>$file_parent)},
"plain");
git_print_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav);
git_print_header_div('commit', esc_html($co{'title'}), $hash_base);
@@ -2765,7 +2782,7 @@ HTML
print "<div class=\"page_body\">\n" .
"<div class=\"diff_info\">blob:" .
$cgi->a({-href => href(action=>"blob", hash=>$hash_parent,
- hash_base=>$hash_base, file_name=>($file_parent || $file_name))},
+ hash_base=>$hash_parent_base, file_name=>($file_parent || $file_name))},
$hash_parent) .
" -> blob:" .
$cgi->a({-href => href(action=>"blob", hash=>$hash,
--
1.4.1.1
^ permalink raw reply related
* Re: Running gitweb under mod_perl
From: Jakub Narebski @ 2006-08-24 20:59 UTC (permalink / raw)
To: git
In-Reply-To: <20060824193220.G4a28fdc4@leonov.stosberg.net>
Dennis Stosberg wrote:
> Jakub Narebski wrote:
>
>> By the way, does the "static" variables works under mod_perl? i.e.
>>
>> {
>> my $private_var = "something"
>>
>> sub some_sub {
>> ...
>> }
>>
>> sub other_sub {
>> ...
>> }
>> }
>
> Depends on what you expect. The variable will remain shared between
> those subs over successive executions, but it will not be reinitialised
> to "something" -- at least not visibly to the subs:
Well, I wanted to share read-only variable, initialized once and not
changed at all. It could be global variable, but it is used only by
those two functions.
> On the first invocation, $private_var is initialised and the two
> subroutines are created. Internally, they refer to the _instance_ of
> $private_var. The next time the script is run by mod_perl, $private_var
> gets initialised again, but the subs are persistent and still refer to
> the old instance. _Their_ copy of the variable will still be shared
> between them, but it will not be reset to "something".
I don't need to reinitialize $private_var -- it is not changed.
> Apache::Registry wraps the whole script in another function, which
> is called on each request, so your piece of code really looks somewhat
> like this:
>
> #!/usr/bin/perl
> sub handler {
> # do something
> {
> my $a = 'A';
> sub sub_a { $a .= 'B' }
> sub sub_b { print $a."\n" }
> }
> sub_a();
> sub_b();
> }
> for(1..10) { handler() }
Thanks for an explanation.
Is there any way to check at _runtime_ if script is run under mod_perl,
or would it be simplier (after script reorganization) for install time
selection of using CGI, FastCGI, or Apache2::something...?
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: [PATCH] git-daemon virtual hosting implementation.
From: Jon Loeliger @ 2006-08-24 20:34 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git List
In-Reply-To: <7vejv598iq.fsf@assigned-by-dhcp.cox.net>
On Thu, 2006-08-24 at 15:35, Junio C Hamano wrote:
> Where is the patch ;-)?
Heh.
Well, I rewrote the interpolation code. As you pointed
out earlier, it was crap. I can send that in; no problem.
There was some outstanding debate if this was actually
the right way to go about things. Specifically, the
problem of canonical hostname. A proposal was to use
peer IP addresses instead, and I just haven't gotten
around to messing with that yet. So that is why I
hadn't sent it in yet. Sorry.
But, I'll rebase it and send it in this evening.
jdl
^ 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