* Re: [PATCH] Always reset the color _before_ printing out the newline
From: Jeff King @ 2006-07-24 13:08 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git, junkio
In-Reply-To: <Pine.LNX.4.63.0607241440340.29667@wbgn013.biozentrum.uni-wuerzburg.de>
On Mon, Jul 24, 2006 at 02:41:41PM +0200, Johannes Schindelin wrote:
> This patch brings the benefits of part of v1.4.1-rc2~37
> to the "commit" colorizing patch.
Oops, yes, I should have thought of that. Patch looks good to me.
-Peff
^ permalink raw reply
* Re: GIT user survey
From: Paolo Ciarrocchi @ 2006-07-24 13:21 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <e9vsv9$iuo$1@sea.gmane.org>
On 7/23/06, Jakub Narebski <jnareb@gmail.com> wrote:
> Paolo Ciarrocchi wrote:
>
> > If you know people using GIT please forward this message to them,
> > currently is has been sent to the following projects:
> > - u-boot
> > - wine
> > - cairo
> > - xmms2
> > - xcb
>
> Check out http://git.or.cz/gitwiki/GitProjects
Thanks. I sent out a few emails to other projects.
regards,
--
Paolo
http://paolo.ciarrocchi.googlepages.com
http://picasaweb.google.com/paolo.ciarrocchi
^ permalink raw reply
* Better Future, yard trader
From: Cathryn Purvis @ 2006-07-24 18:49 UTC (permalink / raw)
To: git-commits-head-owner
Your cre dit doesn't matter to us! If you OWN real est ate
and want IMMEDIATEG cash to spend ANY way you like, or simply wish
to LOWER your monthly paym ents by a third or more, here are the dea ls
we have TODAY (hurry, these ofers will expre TONIGHT):
$488,000.00 at a 3.67,% fixed-rateX
$372,000.00 at a 3.90,% variable-rate6
$492,000.00 at a 3.21,% interest-onlyE
$248,000.00 at a 3.36,% fixed-rate4
$198,000.00 at a 3.55,% variable-rate0
Hurry, when these deals are gone, they are gone Simply fill out this one-min ute form...
Don't worry about approval, your cre dit will not disqualify you!
http://WE8KUEJD.fortessed.com
wrong--that it would disappoint him, evoke doubts, throw him from the cloud
harder with his elbow and his knees. just get there, just a little more,
other on the rusty rails. Redrick unbuttoned a flap and took out a package
Redrick walked behind him, and as soon as he stepped out of the shade, the
car, and lay down, his elbow on the backpack.
could hear another peal of thunder. I'll shake your souls out of you for
on its axles, and he remembered that they could rest in the shade of the
the rounded bristly peaks of the hills. Here and there between the hills
"Forward! Forward!" he shouted, unable to hear himself.
"Well, I guessed! I don't remember exactly what gave me the clue. Well,
it's getting light!"
^ permalink raw reply
* Re: GIT user survey
From: Wolfgang Denk @ 2006-07-24 19:47 UTC (permalink / raw)
To: Paolo Ciarrocchi; +Cc: Git Mailing List
In-Reply-To: <4d8e3fd30607230145i2480c20fxb06127c8b0187c98@mail.gmail.com>
In message <4d8e3fd30607230145i2480c20fxb06127c8b0187c98@mail.gmail.com> you wrote:
>
> If you know people using GIT please forward this message to them,
> currently is has been sent to the following projects:
> - u-boot
Has it? When? I haven't seen anything.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
The thing is, as you progress in the Craft, you'll learn there is
another rule... When you break rules, break 'em good and hard.
- Terry Pratchett, _Wyrd Sisters_
^ permalink raw reply
* Re: GIT user survey
From: Paolo Ciarrocchi @ 2006-07-24 19:50 UTC (permalink / raw)
To: Wolfgang Denk; +Cc: Git Mailing List
In-Reply-To: <20060724194716.1B4EB352640@atlas.denx.de>
On 7/24/06, Wolfgang Denk <wd@denx.de> wrote:
> In message <4d8e3fd30607230145i2480c20fxb06127c8b0187c98@mail.gmail.com> you wrote:
> >
> > If you know people using GIT please forward this message to them,
> > currently is has been sent to the following projects:
> > - u-boot
>
>
> Has it? When? I haven't seen anything.
>
I don't follow the project but I know that NOW it's using GIT, see the
homepage http://u-boot.sourceforge.net/
regards,
--
Paolo
http://paolo.ciarrocchi.googlepages.com
http://picasaweb.google.com/paolo.ciarrocchi
^ permalink raw reply
* Re: GIT user survey
From: Wolfgang Denk @ 2006-07-24 20:11 UTC (permalink / raw)
To: Paolo Ciarrocchi; +Cc: Git Mailing List
In-Reply-To: <4d8e3fd30607241250k3b1a7768yb27653750ae921b3@mail.gmail.com>
In message <4d8e3fd30607241250k3b1a7768yb27653750ae921b3@mail.gmail.com> you wrote:
>
> > > If you know people using GIT please forward this message to them,
> > > currently is has been sent to the following projects:
> > > - u-boot
> >
> > Has it? When? I haven't seen anything.
>
> I don't follow the project but I know that NOW it's using GIT, see the
> homepage http://u-boot.sourceforge.net/
Of course we use git; that's not the question.
I understood your posting such that you have sent a "GIT user survey"
to the U-Boot mailing list: you wrote: "is [typo for `it' ? -
referring to Subject:, i. e. `GIT user survey'?] has been sent to the
following projects..."
I wanted to make clear that nothing has been sent to the U-Boot
project. At least I haven't seen anything, nor can I find anything in
the archives.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
"I've seen it. It's rubbish." - Marvin the Paranoid Android
^ permalink raw reply
* Re: GIT user survey
From: Paolo Ciarrocchi @ 2006-07-24 20:15 UTC (permalink / raw)
To: Wolfgang Denk; +Cc: Git Mailing List
In-Reply-To: <20060724201110.5B14635363E@atlas.denx.de>
On 7/24/06, Wolfgang Denk <wd@denx.de> wrote:
> In message <4d8e3fd30607241250k3b1a7768yb27653750ae921b3@mail.gmail.com> you wrote:
> >
> > > > If you know people using GIT please forward this message to them,
> > > > currently is has been sent to the following projects:
> > > > - u-boot
> > >
> > > Has it? When? I haven't seen anything.
> >
> > I don't follow the project but I know that NOW it's using GIT, see the
> > homepage http://u-boot.sourceforge.net/
>
> Of course we use git; that's not the question.
Doh :-)
> I understood your posting such that you have sent a "GIT user survey"
> to the U-Boot mailing list: you wrote: "is [typo for `it' ? -
> referring to Subject:, i. e. `GIT user survey'?] has been sent to the
> following projects..."
Yep, that was a typo.
And yes, I sent an email to u-boot-users@lists.sourceforge.net
Is that the correct email address?
> I wanted to make clear that nothing has been sent to the U-Boot
> project. At least I haven't seen anything, nor can I find anything in
> the archives.
Can you please FW my original email to the list?
Thanks.
regards,
--
Paolo
http://paolo.ciarrocchi.googlepages.com
http://picasaweb.google.com/paolo.ciarrocchi
^ permalink raw reply
* [PATCH] gitweb: escape tag comments
From: Daniel Drake @ 2006-07-24 22:07 UTC (permalink / raw)
To: junkio; +Cc: git, kay.sievers
I have a tag with a comment which includes an & character. Firefox wouldn't
display my gitweb summary page due to malformed XML. This solves the problem.
Signed-off-by: Daniel Drake <dsd@gentoo.org>
diff --git a/gitweb/gitweb.cgi b/gitweb/gitweb.cgi
index 2fd1e5f..5acd66d 100755
--- a/gitweb/gitweb.cgi
+++ b/gitweb/gitweb.cgi
@@ -1138,7 +1138,7 @@ sub git_summary {
"</td>\n" .
"<td>";
if (defined($comment)) {
- print $cgi->a({-class => "list", -href => "$my_uri?" . esc_param("p=$project;a=tag;h=$tag{'id'}")}, $comment);
+ print $cgi->a({-class => "list", -href => "$my_uri?" . esc_param("p=$project;a=tag;h=$tag{'id'}")}, esc_html($comment));
}
print "</td>\n" .
"<td class=\"link\">";
^ permalink raw reply related
* Re: [PATCH 1/2] add git-quote: shell and C quoting tool
From: Alex Riesen @ 2006-07-24 23:12 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vwta3h7r2.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano, Mon, Jul 24, 2006 07:49:53 +0200:
> > In case anyone asks why isn't it a standalone tool nor is it put into
> > git-stripspace: I don't know. Maybe it should be.
>
> This organization is fine by me.
>
> * unquote?
Not done yet. I actually never expected it to be used for unquoting,
being naturally unquoted by bash. C-quoting was done just because it
was so simple to do. I have no idea where could that be used.
> * doc?
Done. Sorry for missing that.
> > +enum {SHELL_QUOTE, C_QUOTE};
> > +static int style = SHELL_QUOTE,
> > + use_stdin = 0;
>
> Shouldn't style be of type which is that unnamed enum?
It should. Done.
> > +static const char *separator = NULL; /* default is space */
> > +static unsigned sep_len = 0;
>
> It is not clear if this is separator of input side or output
> side (after reading the code it becomes somewhat obvious that
> you are talking about output separator), and if the default is
> space wouldn't it make more sense to set that here?
Right. It is out_separator now.
> > +static const char builtin_quote_usage[] =
> > +"git-quote [--c] [--sep=<c-quoted> | -z] ( [--stdin] | [--] ... )";
> > +
> > +static void print_quoted(const char *text)
> > +{
> > + switch (style)
> > + {
> > + case SHELL_QUOTE:
> > + sq_quote_print(stdout, text);
> > + break;
> > + case C_QUOTE:
> > + quote_c_style(text, NULL, stdout, 0);
> > + break;
> > + }
>
> Not a big deal but aren't these going to write out things quoted
> when they do not need to? To help scripts, it might be worth
> adding "check if this needs quoting" interface perhaps?
Not done yet. "--no-overquote"?
> > + if (!strcmp(arg, "--c")) {
>
> Perhaps "--c-style" with "-c" as a shorthand, (and
> "--shell-style" with "-s" to complement)?
Done. --sh-style.
> > + style = C_QUOTE;
> > + continue;
> > + }
> > + if (!strcmp(arg, "-z")) {
> > + separator = "";
> > + sep_len = 1;
> > + continue;
> > + }
>
> Is it plausible that somebody might want to feed you NUL
> terminated sequence as input (iow you might want to give them
> choice of separator on the input side)?
Done. -z sets both separators to NUL, --in-separator=<c-style> defines
by its first character the input separator. I.e.:
$ find | git quote -z --in-separator='\n'
'a'\0'b'\0''
which is not all that useful...
> > + if (!strncmp(arg, "--sep=", 6)) {
>
> Perhaps "--separator" (or "--output-separator") with whatever
> shorthand is handy?
--out-separator. No idea of a shortcut, though
> > + separator = unquote_c_style(tmp, &end);
> > + sep_len = strlen(separator);
>
> If the parameter is a malformed c-quoted string, you would dump
> core here.
Oops. Fixed.
> > + if (!separator) {
> > + sep_len = 1;
> > + separator = "\x20";
>
> Any reason you needed to spell it in hex? Is this trying to
> be portable to EBCDIC (or trying to prevent the code to be
> ported there)? I dunno.
Visibility. I have dificulty seeing spaces and tabs.
I changed it anyway, maybe that's just me.
> > + while (EOF != (ch = fgetc(stdin))) {
>
> Looks similar to strbuf.c::read_line() loop...
>
Indeed. Replaced.
I attach the updated patch here, because it is obviously is not quite
finished yet and I probably wont have enough time over the week. So
maybe someone takes over. Or it'll be taken as is, that happens too.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
diff --git a/Documentation/git-quote.txt b/Documentation/git-quote.txt
new file mode 100644
index 0000000..98b2859
--- /dev/null
+++ b/Documentation/git-quote.txt
@@ -0,0 +1,70 @@
+git-quote(1)
+============
+
+NAME
+----
+git-quote - Quote given text according to Shell or C rules
+
+
+SYNOPSIS
+--------
+'git-quote' [-c] [-s] [-s] [--out-separator=<c-quoted>]
+ [--in-separator=<c-quoted>] [-z] [--] ...
+'git-quote' ... --stdin < <stream>
+
+DESCRIPTION
+-----------
+Quote the lines according to the given rules, which can be Shell backslash
+quoting (every line is enclosed in single ticks, backslash and single tick
+quoted specially) or a C quoting (use double ticks and backslash-prefixed
+symbols).
+
+The separator options are handled in the order they are given, so one
+can save some typing by giving "-z" first, and overriding input or
+output separator as needed.
+
+OPTIONS
+-------
+-c|--c-style::
+ Select C-style quoting
+
+-s|--sh-style::
+ Select Shell-style quoting. This is default.
+
+--out-separator=<c-quoted>::
+ Specify the separator between the output elements. If the separator
+ have to contain special characters, they must be quoted according
+ to C quoting rules (double ticks are not essential).
+ The ASCII space is default output separator.
+
+--in-separator=<c-quoted>::
+ Specify the separator between the input elements. Only the
+ first character of <c-quoted> is used.
+ Used only if --stdin is also given. The default is LF.
+
+-z::
+ Separate the elements on output and expect elements separated
+ on input with NUL character.
+ Used only if --stdin is also given.
+
+--stdin::
+ Specify that the elements have to be read from stdin.
+ This option ends command line parsing.
+ Also, if there were no output separator set by previous
+ --out-separator or -z, this option will set it to LF.
+
+<stream>::
+ Byte stream to act on.
+
+Author
+------
+Written by Alex Riesen <raa.lkml@gmail.com>
+
+Documentation
+--------------
+Documentation by Alex Riesen.
+
+GIT
+---
+Part of the gitlink:git[7] suite
+
diff --git a/Makefile b/Makefile
index 3e085df..4df2951 100644
--- a/Makefile
+++ b/Makefile
@@ -246,7 +246,8 @@ BUILTIN_OBJS = \
builtin-apply.o builtin-show-branch.o builtin-diff-files.o \
builtin-diff-index.o builtin-diff-stages.o builtin-diff-tree.o \
builtin-cat-file.o builtin-mailsplit.o builtin-stripspace.o \
- builtin-update-ref.o builtin-fmt-merge-msg.o builtin-prune.o
+ builtin-update-ref.o builtin-fmt-merge-msg.o builtin-prune.o \
+ builtin-quote.o
GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
LIBS = $(GITLIBS) -lz
diff --git a/builtin-quote.c b/builtin-quote.c
new file mode 100644
index 0000000..d9d4b00
--- /dev/null
+++ b/builtin-quote.c
@@ -0,0 +1,123 @@
+/*
+ * "git quote" builtin command
+ *
+ * DOES NOT QUOTE \0 (truncates lines at it)
+ */
+#include "cache.h"
+#include "builtin.h"
+#include "strbuf.h"
+#include "quote.h"
+
+static enum {SHELL_QUOTE, C_QUOTE} style = SHELL_QUOTE;
+static int use_stdin = 0;
+static const char *out_separator = NULL; /* default is space */
+static unsigned out_separator_len = 0;
+
+static const char builtin_quote_usage[] =
+"git-quote [-c | -s] [--out-separator=<c-quoted> | -z] ( [--stdin] | [--] ... )";
+
+static void print_quoted(const char *text)
+{
+ switch (style)
+ {
+ case SHELL_QUOTE:
+ sq_quote_print(stdout, text);
+ break;
+ case C_QUOTE:
+ quote_c_style(text, NULL, stdout, 0);
+ break;
+ }
+ fwrite(out_separator, 1, out_separator_len, stdout);
+}
+
+static char *unquote_c_arg(const char *arg)
+{
+ const char *end;
+ char *tmp;
+ char *result;
+ if ('"' == *arg)
+ tmp = strdup(arg);
+ else {
+ size_t l = strlen(arg);
+ tmp = malloc(l + 3);
+ sprintf(tmp, "\"%s\"", arg);
+ }
+ result = unquote_c_style(tmp, &end);
+ free(tmp);
+ return result;
+}
+
+int cmd_quote(int argc, const char **argv, char **envp)
+{
+ int in_separator = '\n';
+ int i;
+ for (i = 1; i < argc; i++) {
+ const char *arg = argv[i];
+
+ if (arg[0] != '-')
+ break;
+ if (!strcmp(arg, "--")) {
+ i++;
+ break;
+ }
+ if (!strcmp(arg, "--stdin")) {
+ use_stdin = 1;
+ if ( !out_separator ) {
+ out_separator = "\n";
+ out_separator_len = 1;
+ }
+ break;
+ }
+ if (!strcmp(arg, "--c-style") || !strcmp(arg, "-c")) {
+ style = C_QUOTE;
+ continue;
+ }
+ if (!strcmp(arg, "--sh-style") || !strcmp(arg, "-s")) {
+ style = SHELL_QUOTE;
+ continue;
+ }
+ if (!strcmp(arg, "-z")) {
+ in_separator = 0;
+ out_separator = "";
+ out_separator_len = 1;
+ continue;
+ }
+ if (!strncmp(arg, "--out-separator=", 16)) {
+ arg += 16;
+ out_separator = unquote_c_arg(arg);
+ if (!out_separator)
+ die("malformed separator '%s'", arg);
+ out_separator_len = strlen(out_separator);
+ /* this will leak if multiple --sep= given */
+ continue;
+ }
+ if (!strncmp(arg, "--in-separator=", 15)) {
+ char *sep;
+ arg += 15;
+ sep = unquote_c_arg(arg);
+ if (!sep || !*sep)
+ die("malformed separator '%s'", arg);
+ in_separator = *sep;
+ free(sep);
+ continue;
+ }
+ die(builtin_quote_usage);
+ }
+ if (!out_separator) {
+ out_separator_len = 1;
+ out_separator = " ";
+ }
+ if (use_stdin) {
+ struct strbuf line;
+ strbuf_init(&line);
+
+ while (!line.eof) {
+ read_line(&line, stdin, in_separator);
+ if (line.len)
+ print_quoted(line.buf);
+ }
+ } else
+ for (; argv[i]; ++i)
+ print_quoted(argv[i]);
+ return 0;
+}
diff --git a/builtin.h b/builtin.h
index 5339d86..9bd522e 100644
--- a/builtin.h
+++ b/builtin.h
@@ -64,4 +64,6 @@ extern int mailinfo(FILE *in, FILE *out,
extern int cmd_stripspace(int argc, const char **argv, char **envp);
extern void stripspace(FILE *in, FILE *out);
+
+extern int cmd_quote(int argc, const char **argv, char **envp);
#endif
diff --git a/git.c b/git.c
index ee5a0e8..f94d25a 100644
--- a/git.c
+++ b/git.c
@@ -202,6 +202,7 @@ static void handle_internal_command(int
{ "update-ref", cmd_update_ref },
{ "fmt-merge-msg", cmd_fmt_merge_msg },
{ "prune", cmd_prune },
+ { "quote", cmd_quote },
};
int i;
^ permalink raw reply related
* [PATCH] Trivial path optimization test
From: Alex Riesen @ 2006-07-24 23:23 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano, Linus Torvalds
In-Reply-To: <Pine.LNX.4.64.0607140828250.5623@g5.osdl.org>
Linus:
get_pathspec() does turn '.' into an empty string (which is
correct - git internally does _not_ ever understand the notion of
"." as the current working directory), but it doesn't ever do the
optimization of noticing that a pathspec that consists solely of
an empty string is "equivalent" to an empty pathspec.
The test is to ensure that this behaviour stays.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
t/t6004-rev-list-path-optim.sh | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/t/t6004-rev-list-path-optim.sh b/t/t6004-rev-list-path-optim.sh
new file mode 100755
index 0000000..5182dbb
--- /dev/null
+++ b/t/t6004-rev-list-path-optim.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+test_description='git-rev-list trivial path optimization test'
+
+. ./test-lib.sh
+
+test_expect_success setup '
+echo Hello > a &&
+git add a &&
+git commit -m "Initial commit" a
+'
+
+test_expect_success path-optimization '
+ commit=$(echo "Unchanged tree" | git-commit-tree "HEAD^{tree}" -p HEAD) &&
+ test $(git-rev-list $commit | wc -l) = 2 &&
+ test $(git-rev-list $commit -- . | wc -l) = 1
+'
+
+test_done
--
1.4.1.gb944
^ permalink raw reply related
* Re: [PATCH] Trivial path optimization test
From: Alex Riesen @ 2006-07-24 23:23 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Linus Torvalds
In-Reply-To: <7v4px7h5df.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano, Mon, Jul 24, 2006 08:41:16 +0200:
> Clean up the commit log pretty please.
No problem.
^ permalink raw reply
* Re: [PATCH] Allow an alias to start with "-p"
From: Junio C Hamano @ 2006-07-25 0:36 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
In-Reply-To: <Pine.LNX.4.63.0607241408170.29667@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Now, something like
>
> [alias]
> pd = -p diff
>
> works as expected.
>
> Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
This seems to break t5400 among other things (git-clone
complains that it is not invoked in a git repository).
^ permalink raw reply
* [ANNOUNCE] GIT 1.4.1.1
From: Junio C Hamano @ 2006-07-25 3:53 UTC (permalink / raw)
To: git; +Cc: linux-kernel
The latest maintenance release GIT 1.4.1.1 is available at the
usual places:
http://www.kernel.org/pub/software/scm/git/
git-1.4.1.1.tar.{gz,bz2} (tarball)
git-htmldocs-1.4.1.1.tar.{gz,bz2} (preformatted docs)
git-manpages-1.4.1.1.tar.{gz,bz2} (preformatted docs)
RPMS/$arch/git-*-1.4.1.1-1.$arch.rpm (RPM)
The primary purpose of this release is to fix the breakage
people reported while cloning large quantity of data via git
protocol, and the server side incorrectly timing out. I am very
sorry for the breakage.
A big thanks goes to Matthias Lederhofer who fixed the breakage
for us. The fix was cherry-picked from the "master" branch.
The "master" branch has the same fix already and we will have an
1.4.2-rc2 sometime this week, hopefully soon.
----------------------------------------------------------------
Changes since v1.4.1 are as follows:
Junio C Hamano:
Makefile: tighten git-http-{fetch,push} dependencies
Linus Torvalds:
revision.c: fix "dense" under --remove-empty
Matthias Lederhofer:
upload-pack: fix timeout in create_pack_file
Robin Rosenberg:
Empty author may be presented by svn as an empty string or a null value.
^ permalink raw reply
* Re: [PATCH] Allow an alias to start with "-p"
From: Jeff King @ 2006-07-25 5:03 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Junio C Hamano, git
In-Reply-To: <Pine.LNX.4.63.0607241408170.29667@wbgn013.biozentrum.uni-wuerzburg.de>
On Mon, Jul 24, 2006 at 02:10:45PM +0200, Johannes Schindelin wrote:
> @@ -264,6 +289,7 @@ int main(int argc, const char **argv, ch
> if (!strncmp(cmd, "git-", 4)) {
> cmd += 4;
> argv[0] = cmd;
> + handle_alias(&argc, &argv);
> handle_internal_command(argc, argv, envp);
> die("cannot handle %s internally", cmd);
> }
I believe this change is the source of the breakage in tests.
GIT_DIR=foo git-init-db no longer works because handle_alias
unconditionally calls setup_git_directory_gently(), which thinks that if
GIT_DIR is set, it must exist.
This can be fixed by giving precedence to the internal command over
alias checking. This makes sense, anyway, since later in the function,
we give precedence to internal commands in the "git init-db" form.
Patch is below (wow, that +++ is kind of ugly!).
-Peff
+++
git: choose internal commands over aliases for git-*
This is especially important because some commands (like init-db) don't
require a working GIT_DIR, and alias expansion tries to look at it. It
also matches the behavior of "git cmd".
Signed-off-by: Jeff King <peff@peff.net>
---
git.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git.c b/git.c
index 8d7c644..68ce826 100644
--- a/git.c
+++ b/git.c
@@ -289,8 +289,8 @@ int main(int argc, const char **argv, ch
if (!strncmp(cmd, "git-", 4)) {
cmd += 4;
argv[0] = cmd;
- handle_alias(&argc, &argv);
handle_internal_command(argc, argv, envp);
+ handle_alias(&argc, &argv);
die("cannot handle %s internally", cmd);
}
--
1.4.2.rc1.gc470-dirty
^ permalink raw reply related
* Re: [PATCH] Allow an alias to start with "-p"
From: Johannes Schindelin @ 2006-07-25 6:18 UTC (permalink / raw)
To: Jeff King; +Cc: Junio C Hamano, git
In-Reply-To: <20060725050312.GA5618@coredump.intra.peff.net>
Hi,
On Tue, 25 Jul 2006, Jeff King wrote:
> On Mon, Jul 24, 2006 at 02:10:45PM +0200, Johannes Schindelin wrote:
>
> > @@ -264,6 +289,7 @@ int main(int argc, const char **argv, ch
> > if (!strncmp(cmd, "git-", 4)) {
> > cmd += 4;
> > argv[0] = cmd;
> > + handle_alias(&argc, &argv);
> > handle_internal_command(argc, argv, envp);
> > die("cannot handle %s internally", cmd);
> > }
My fault. This was a left-over from my original alias patch. (I did a
merge, and just used "git-diff next" instead of "git-diff --merge next".
<Clickety-click/> Nope, that would not have worked either.
> Patch is below (wow, that +++ is kind of ugly!).
Same here.
> git: choose internal commands over aliases for git-*
>
> This is especially important because some commands (like init-db) don't
> require a working GIT_DIR, and alias expansion tries to look at it. It
> also matches the behavior of "git cmd".
>
> Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
> @@ -289,8 +289,8 @@ int main(int argc, const char **argv, ch
> if (!strncmp(cmd, "git-", 4)) {
> cmd += 4;
> argv[0] = cmd;
> - handle_alias(&argc, &argv);
> handle_internal_command(argc, argv, envp);
> + handle_alias(&argc, &argv);
> die("cannot handle %s internally", cmd);
> }
Alternatively, you can just delete it. IIRC we decided that aliases with
"git-" commands do not make sense.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH] Allow an alias to start with "-p"
From: Johannes Schindelin @ 2006-07-25 6:27 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7virlmfrl4.fsf@assigned-by-dhcp.cox.net>
Hi,
On Mon, 24 Jul 2006, Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > Now, something like
> >
> > [alias]
> > pd = -p diff
> >
> > works as expected.
> >
> > Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
>
> This seems to break t5400 among other things (git-clone
> complains that it is not invoked in a git repository).
See Peff's mail for a fix (hopefully: I do not see why git-clone should
be affected, as it is a script, not a hard link to the git wrapper). The
funny thing: t5400 does not break here.
Ciao,
Dscho
^ permalink raw reply
* [PATCH] Substitute xmalloc()+memset(0) with xcalloc().
From: Peter Eriksen @ 2006-07-25 7:30 UTC (permalink / raw)
To: git
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
---
builtin-add.c | 3 +--
builtin-rm.c | 3 +--
combine-diff.c | 3 +--
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/builtin-add.c b/builtin-add.c
index 2d25698..3a73a17 100644
--- a/builtin-add.c
+++ b/builtin-add.c
@@ -21,8 +21,7 @@ static void prune_directory(struct dir_s
for (specs = 0; pathspec[specs]; specs++)
/* nothing */;
- seen = xmalloc(specs);
- memset(seen, 0, specs);
+ seen = xcalloc(specs, 1);
src = dst = dir->entries;
i = dir->nr;
diff --git a/builtin-rm.c b/builtin-rm.c
index 5deb811..bb810ba 100644
--- a/builtin-rm.c
+++ b/builtin-rm.c
@@ -90,8 +90,7 @@ int cmd_rm(int argc, const char **argv,
seen = NULL;
for (i = 0; pathspec[i] ; i++)
/* nothing */;
- seen = xmalloc(i);
- memset(seen, 0, i);
+ seen = xcalloc(i, 1);
for (i = 0; i < active_nr; i++) {
struct cache_entry *ce = active_cache[i];
diff --git a/combine-diff.c b/combine-diff.c
index 1bc1484..919112b 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -639,8 +639,7 @@ static int show_patch_diff(struct combin
/* deleted file */
result_size = 0;
elem->mode = 0;
- result = xmalloc(1);
- result[0] = 0;
+ result = xcalloc(1, 1);
}
if (0 <= fd)
close(fd);
--
1.4.2.rc1.ge7a0
^ permalink raw reply related
* Better Life, working fit
From: Herman Hutton @ 2006-07-25 10:14 UTC (permalink / raw)
To: git-commits-head-owner
Your cre dit doesn't matter to us! If you OWN real est ate
and want IMMEDIATEV cash to spend ANY way you like, or simply wish
to LOWER your monthly paym ents by a third or more, here are the dea ls
we have TODAY (hurry, these ofers will expre TONIGHT):
$488,000.00 at a 3.67,% fixed-rateJ
$372,000.00 at a 3.90,% variable-rateP
$492,000.00 at a 3.21,% interest-only2
$248,000.00 at a 3.36,% fixed-rate0
$198,000.00 at a 3.55,% variable-rateL
Hurry, when these deals are gone, they are gone Simply fill out this one-min ute form...
Don't worry about approval, your cre dit will not disqualify you!
http://V2NBH159.fortessed.com
"Look at that, Mr. Schuhart," he said, livening up. "Father must have
many of the tales had it. It lay where it had fallen. Maybe it had fallen
promises--I've had enough, you've led me by the nose long enough. All my
to do, don't suddenly be afraid of the dirt. If I tell you to, drop your
explanation of what was going on. Redrick listened for a minute or two and
was about to start when he stopped suddenly.
stalactites that looked like fat candles hanging from the jagged edges of
Every step raised a cloud of white dust, and the dust settled on his
have happened, he would have gotten blisters on his feet--and that would
Buzzard. If you only knew, Buzzard, that I took your advice this time. "This
The mud slurped underfoot. It was a dead swamp--no bugs, no frogs, even the
^ permalink raw reply
* [PATCH] cvsserver: suppress warnings
From: Johannes Schindelin @ 2006-07-25 10:48 UTC (permalink / raw)
To: git, junkio, Martin Langhoff
This patch defines $state->{prependdir} as the empty string, so that
quite a few warnings are avoided.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
I still get this warning:
closing dbh with active statement handles
git-cvsserver.perl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 9c9f21b..981b6ba 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -81,7 +81,7 @@ ########################################
# $state holds all the bits of information the clients sends us that could
# potentially be useful when it comes to actually _doing_ something.
-my $state = {};
+my $state = { prependdir => '' };
$log->info("--------------- STARTING -----------------");
my $TEMP_DIR = tempdir( CLEANUP => 1 );
--
1.4.2.rc1.gc123
^ permalink raw reply related
* Re: [PATCH] cvsserver: suppress warnings
From: Martin Langhoff (CatalystIT) @ 2006-07-25 11:06 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git, junkio
In-Reply-To: <Pine.LNX.4.63.0607251247040.29667@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin wrote:
> This patch defines $state->{prependdir} as the empty string, so that
> quite a few warnings are avoided.
Ack.
> I still get this warning:
>
> closing dbh with active statement handles
Ack to that too. Perhaps an END block would help? A quick check of man
DBI tells me that $dbh->CachedKids will be a hashref where the values
are refs to the cached statement handles.
IMHO it's a DBI bug -- statement handles only referenced by
$dbh->CachedKids should cleanup silently. prepare_cached() is a
convenience method so that you _don't_ have to keep track of the handles
manually. Forcing a manual cleanup throws a good part of the convenience
out.
cheers,
martin
--
-----------------------------------------------------------------------
Martin @ Catalyst .Net .NZ Ltd, PO Box 11-053, Manners St, Wellington
WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St
OFFICE: +64(4)916-7224 MOB: +64(21)364-017
Make things as simple as possible, but no simpler - Einstein
-----------------------------------------------------------------------
^ permalink raw reply
* Re: [PATCH] cvsserver: suppress warnings
From: Johannes Schindelin @ 2006-07-25 11:11 UTC (permalink / raw)
To: Martin Langhoff (CatalystIT); +Cc: git, junkio
In-Reply-To: <44C5FB3E.9020301@catalyst.net.nz>
Hi,
On Tue, 25 Jul 2006, Martin Langhoff (CatalystIT) wrote:
> Johannes Schindelin wrote:
>
> > I still get this warning:
> >
> > closing dbh with active statement handles
>
> Ack to that too. Perhaps an END block would help?
Since my BASIC days on a VC-20 (no, not the airplane), I hardly used an
END statement ;-) Well, maybe in that Pascal course, but not in Perl,
anyway. So, I do not understand...
> A quick check of man DBI tells me that $dbh->CachedKids will be a
> hashref where the values are refs to the cached statement handles.
>
> IMHO it's a DBI bug -- statement handles only referenced by $dbh->CachedKids
> should cleanup silently. prepare_cached() is a convenience method so that you
> _don't_ have to keep track of the handles manually. Forcing a manual cleanup
> throws a good part of the convenience out.
I agree fully.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH] cvsserver: suppress warnings
From: Martin Langhoff @ 2006-07-25 11:50 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Martin Langhoff (CatalystIT), git, junkio
In-Reply-To: <Pine.LNX.4.63.0607251308380.29667@wbgn013.biozentrum.uni-wuerzburg.de>
On 7/25/06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > Ack to that too. Perhaps an END block would help?
>
> Since my BASIC days on a VC-20 (no, not the airplane), I hardly used an
> END statement ;-) Well, maybe in that Pascal course, but not in Perl,
> anyway. So, I do not understand...
Oh, it's a code block you can declare that gets called when the
program is exiting. More info at
http://search.cpan.org/dist/perl/pod/perlmod.pod#BEGIN%2C_CHECK%2C_INIT_and_END____
No relation to BASIC's END ;-)
martin
^ permalink raw reply
* Re: [PATCH] cvsserver: suppress warnings
From: Johannes Schindelin @ 2006-07-25 11:56 UTC (permalink / raw)
To: Martin Langhoff; +Cc: Martin Langhoff (CatalystIT), git, junkio
In-Reply-To: <46a038f90607250450l643f97e4sbece300fa5b2d509@mail.gmail.com>
Hi,
On Tue, 25 Jul 2006, Martin Langhoff wrote:
> On 7/25/06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>
> > > Ack to that too. Perhaps an END block would help?
> >
> > Since my BASIC days on a VC-20 (no, not the airplane), I hardly used an
> > END statement ;-) Well, maybe in that Pascal course, but not in Perl,
> > anyway. So, I do not understand...
>
> Oh, it's a code block you can declare that gets called when the
> program is exiting. More info at
> http://search.cpan.org/dist/perl/pod/perlmod.pod#BEGIN%2C_CHECK%2C_INIT_and_END____
Ah! Something like "atexit()".
> No relation to BASIC's END ;-)
;-)
BTW I will send out a proper patch for that warning shortly.
Ciao,
Dscho
^ permalink raw reply
* [PATCH] cvsserver: avoid warning about active db handles
From: Johannes Schindelin @ 2006-07-25 11:57 UTC (permalink / raw)
To: git, Martin Langhoff (CatalystIT), junkio
Turns out that DBD::SQLite does not favour preparing statements which are
never executed. So, turn all 4 statements, which were prepared _always_,
into methods, like the other 12 prepared statements.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
Now, the only warning left is the gzip one...
git-cvsserver.perl | 70 ++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 56 insertions(+), 14 deletions(-)
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 981b6ba..b2837ad 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -2131,12 +2131,6 @@ sub update
# first lets get the commit list
$ENV{GIT_DIR} = $self->{git_path};
- # prepare database queries
- my $db_insert_rev = $self->{dbh}->prepare_cached("INSERT INTO revision (name, revision, filehash, commithash, modified, author, mode) VALUES (?,?,?,?,?,?,?)",{},1);
- my $db_insert_mergelog = $self->{dbh}->prepare_cached("INSERT INTO commitmsgs (key, value) VALUES (?,?)",{},1);
- my $db_delete_head = $self->{dbh}->prepare_cached("DELETE FROM head",{},1);
- my $db_insert_head = $self->{dbh}->prepare_cached("INSERT INTO head (name, revision, filehash, commithash, modified, author, mode) VALUES (?,?,?,?,?,?,?)",{},1);
-
my $commitinfo = `git-cat-file commit $self->{module} 2>&1`;
unless ( $commitinfo =~ /tree\s+[a-zA-Z0-9]{40}/ )
{
@@ -2325,7 +2319,7 @@ sub update
author => $commit->{author},
mode => $git_perms,
};
- $db_insert_rev->execute($4, $head->{$4}{revision}, $2, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
+ $self->insert_rev($4, $head->{$4}{revision}, $2, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
}
elsif ( $3 eq "M" )
{
@@ -2339,7 +2333,7 @@ sub update
author => $commit->{author},
mode => $git_perms,
};
- $db_insert_rev->execute($4, $head->{$4}{revision}, $2, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
+ $self->insert_rev($4, $head->{$4}{revision}, $2, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
}
elsif ( $3 eq "A" )
{
@@ -2353,7 +2347,7 @@ sub update
author => $commit->{author},
mode => $git_perms,
};
- $db_insert_rev->execute($4, $head->{$4}{revision}, $2, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
+ $self->insert_rev($4, $head->{$4}{revision}, $2, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
}
else
{
@@ -2410,7 +2404,7 @@ sub update
};
- $db_insert_rev->execute($git_filename, $newrevision, $git_hash, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
+ $self->insert_rev($git_filename, $newrevision, $git_hash, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
}
}
close FILELIST;
@@ -2426,7 +2420,7 @@ sub update
$head->{$file}{modified} = $commit->{date};
$head->{$file}{author} = $commit->{author};
- $db_insert_rev->execute($file, $head->{$file}{revision}, $head->{$file}{filehash}, $commit->{hash}, $commit->{date}, $commit->{author}, $head->{$file}{mode});
+ $self->insert_rev($file, $head->{$file}{revision}, $head->{$file}{filehash}, $commit->{hash}, $commit->{date}, $commit->{author}, $head->{$file}{mode});
}
}
# END : "Detect deleted files"
@@ -2435,7 +2429,7 @@ sub update
if (exists $commit->{mergemsg})
{
- $db_insert_mergelog->execute($commit->{hash}, $commit->{mergemsg});
+ $self->insert_mergelog($commit->{hash}, $commit->{mergemsg});
}
$lastpicked = $commit->{hash};
@@ -2443,10 +2437,10 @@ sub update
$self->_set_prop("last_commit", $commit->{hash});
}
- $db_delete_head->execute();
+ $self->delete_head();
foreach my $file ( keys %$head )
{
- $db_insert_head->execute(
+ $self->insert_head(
$file,
$head->{$file}{revision},
$head->{$file}{filehash},
@@ -2464,6 +2458,54 @@ sub update
$self->{dbh}->commit() or die "Failed to commit changes to SQLite";
}
+sub insert_rev
+{
+ my $self = shift;
+ my $name = shift;
+ my $revision = shift;
+ my $filehash = shift;
+ my $commithash = shift;
+ my $modified = shift;
+ my $author = shift;
+ my $mode = shift;
+
+ my $insert_rev = $self->{dbh}->prepare_cached("INSERT INTO revision (name, revision, filehash, commithash, modified, author, mode) VALUES (?,?,?,?,?,?,?)",{},1);
+ $insert_rev->execute($name, $revision, $filehash, $commithash, $modified, $author, $mode);
+}
+
+sub insert_mergelog
+{
+ my $self = shift;
+ my $key = shift;
+ my $value = shift;
+
+ my $insert_mergelog = $self->{dbh}->prepare_cached("INSERT INTO commitmsgs (key, value) VALUES (?,?)",{},1);
+ $insert_mergelog->execute($key, $value);
+}
+
+sub delete_head
+{
+ my $self = shift;
+
+ my $delete_head = $self->{dbh}->prepare_cached("DELETE FROM head",{},1);
+ $delete_head->execute();
+}
+
+sub insert_head
+{
+ my $self = shift;
+ my $name = shift;
+ my $revision = shift;
+ my $filehash = shift;
+ my $commithash = shift;
+ my $modified = shift;
+ my $author = shift;
+ my $mode = shift;
+
+ my $insert_head = $self->{dbh}->prepare_cached("INSERT INTO head (name, revision, filehash, commithash, modified, author, mode) VALUES (?,?,?,?,?,?,?)",{},1);
+ $insert_head->execute($name, $revision, $filehash, $commithash, $modified, $author, $mode);
+}
+
sub _headrev
{
my $self = shift;
--
1.4.2.rc1.gd3c5-dirty
^ permalink raw reply related
* git-1.4.1.1-1 git-clone-pack: unable to read from git-index-pack
From: Mike Galbraith @ 2006-07-25 12:13 UTC (permalink / raw)
To: git
In-Reply-To: <Pine.LNX.4.63.0607251247040.29667@wbgn013.biozentrum.uni-wuerzburg.de>
Greetings,
Having finally acquired DSL (only 400kbps, but at least I'm in the
twentieth century [not typo]), I decided to finally give git a try. I
installed git-1.4.1.1-1, and armed myself with Jeff's how-to. I didn't
get far before git saved me the trouble of truly testing my resolve :)
-Mike
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git linux-2.6
error: git-clone-pack: unable to read from git-index-pack
error: git-index-pack died with error code 128
clone-pack from 'git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git' failed
^ 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