* Re: git-rev-parse --symbolic-abbrev-name
From: Junio C Hamano @ 2009-01-04 19:36 UTC (permalink / raw)
To: Karl Chen; +Cc: Miklos Vajna, David Aguilar, Git mailing list
In-Reply-To: <quack.20090104T0434.lthfxjz1c8x_-_@roar.cs.berkeley.edu>
Karl Chen <quarl@cs.berkeley.edu> writes:
> ... you really think "branchfoo" instead of
> "refs/heads/branchfoo" is a narrow special case?
Of course it is narrower. There are namespaces other than "heads" under
refs, and not everybody is interested in branches.
> obviously all those people posting on blogs don't know about it :)
Yes, and that won't be helped by any new option to the plumbing.
The above two does not necessarily mean that it is useless to add a new
option to help a narrow special case that is common, though.
^ permalink raw reply
* Re: [PATCH] cvsserver: add option to configure commit message
From: Junio C Hamano @ 2009-01-04 19:20 UTC (permalink / raw)
To: Lars Noschinski; +Cc: Fabian Emmes, git
In-Reply-To: <20090104112318.GB7732@lars.home.noschinski.de>
Lars Noschinski <lars@public.noschinski.de> writes:
> It is "Fabian and Lars developed it and Fabian is the one who mailed it
> for inclusion". We could just leave off the second S-o-b line, if this
> is less irritating?
Oh, no, no. It is not an irritation at all. I found it unusual and
that's all.
Thanks.
^ permalink raw reply
* Re: [PATCH rfc v2] git-sh-setup: Fix scripts whose PWD is a symlink to a work-dir on OS X
From: Marcel Koeppen @ 2009-01-04 18:49 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Marcel M. Cary, git, jnareb, ae, j.sixt
In-Reply-To: <7v8wps59ss.fsf@gitster.siamese.dyndns.org>
Am 03.01.2009 um 23:01 schrieb Junio C Hamano:
> "Marcel M. Cary" <marcel@oak.homeunix.org> writes:
>
>> I sent the first rev of this patch to just Brian. It didn't have
>> either of the unit test changes. He said it fixed all but t2300.3,
>> where cd_to_toplevel doesn't actually "cd", so I made the same change
>> to the unit test itself. Can someone with OS X try running the test
>> suite with v2 of this patch? I don't have OS X readily available.
>
> I think I saw a success report on the list. Care to resend it with
> Sign-off (by you) and
>
> Tested-by: tester <test@er.xz> (on PLATFORM)
>
> lines as you see necessary for application?
>
> Thanks.
Hi,
please add
Tested-by: Marcel Koeppen <git-dev@marzelpan.de> (on Mac OS X 10.5.6)
Marcel
^ permalink raw reply
* [PATCH] Replace deprecated dashed git commands in usage
From: Alexander Potashev @ 2009-01-04 18:39 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git Mailing List, Alexander Potashev
Signed-off-by: Alexander Potashev <aspotashev@gmail.com>
---
builtin-merge.c | 4 ++--
builtin-receive-pack.c | 2 +-
builtin-verify-pack.c | 2 +-
merge-index.c | 2 +-
merge-tree.c | 2 +-
mktag.c | 2 +-
mktree.c | 2 +-
patch-id.c | 2 +-
unpack-file.c | 2 +-
upload-pack.c | 2 +-
10 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/builtin-merge.c b/builtin-merge.c
index cf86975..261a92e 100644
--- a/builtin-merge.c
+++ b/builtin-merge.c
@@ -36,8 +36,8 @@ struct strategy {
};
static const char * const builtin_merge_usage[] = {
- "git-merge [options] <remote>...",
- "git-merge [options] <msg> HEAD <remote>",
+ "git merge [options] <remote>...",
+ "git merge [options] <msg> HEAD <remote>",
NULL
};
diff --git a/builtin-receive-pack.c b/builtin-receive-pack.c
index db67c31..929df19 100644
--- a/builtin-receive-pack.c
+++ b/builtin-receive-pack.c
@@ -9,7 +9,7 @@
#include "remote.h"
#include "transport.h"
-static const char receive_pack_usage[] = "git-receive-pack <git-dir>";
+static const char receive_pack_usage[] = "git receive-pack <git-dir>";
enum deny_action {
DENY_IGNORE,
diff --git a/builtin-verify-pack.c b/builtin-verify-pack.c
index 25a29f1..0ee0a9a 100644
--- a/builtin-verify-pack.c
+++ b/builtin-verify-pack.c
@@ -107,7 +107,7 @@ static int verify_one_pack(const char *path, int verbose)
return err;
}
-static const char verify_pack_usage[] = "git-verify-pack [-v] <pack>...";
+static const char verify_pack_usage[] = "git verify-pack [-v] <pack>...";
int cmd_verify_pack(int argc, const char **argv, const char *prefix)
{
diff --git a/merge-index.c b/merge-index.c
index 7827e87..a6e1921 100644
--- a/merge-index.c
+++ b/merge-index.c
@@ -91,7 +91,7 @@ int main(int argc, char **argv)
signal(SIGCHLD, SIG_DFL);
if (argc < 3)
- usage("git-merge-index [-o] [-q] <merge-program> (-a | [--] <filename>*)");
+ usage("git merge-index [-o] [-q] <merge-program> (-a | [--] <filename>*)");
setup_git_directory();
read_cache();
diff --git a/merge-tree.c b/merge-tree.c
index 2d1413e..4f567a4 100644
--- a/merge-tree.c
+++ b/merge-tree.c
@@ -3,7 +3,7 @@
#include "xdiff-interface.h"
#include "blob.h"
-static const char merge_tree_usage[] = "git-merge-tree <base-tree> <branch1> <branch2>";
+static const char merge_tree_usage[] = "git merge-tree <base-tree> <branch1> <branch2>";
static int resolve_directories = 1;
struct merge_list {
diff --git a/mktag.c b/mktag.c
index ba3d495..9a93ce2 100644
--- a/mktag.c
+++ b/mktag.c
@@ -157,7 +157,7 @@ int main(int argc, char **argv)
unsigned char result_sha1[20];
if (argc != 1)
- usage("git-mktag < signaturefile");
+ usage("git mktag < signaturefile");
setup_git_directory();
diff --git a/mktree.c b/mktree.c
index 514fd9b..0f98bc7 100644
--- a/mktree.c
+++ b/mktree.c
@@ -61,7 +61,7 @@ static void write_tree(unsigned char *sha1)
write_sha1_file(buf.buf, buf.len, tree_type, sha1);
}
-static const char mktree_usage[] = "git-mktree [-z]";
+static const char mktree_usage[] = "git mktree [-z]";
int main(int ac, char **av)
{
diff --git a/patch-id.c b/patch-id.c
index 871f1d2..429c3a2 100644
--- a/patch-id.c
+++ b/patch-id.c
@@ -72,7 +72,7 @@ static void generate_id_list(void)
flush_current_id(patchlen, sha1, &ctx);
}
-static const char patch_id_usage[] = "git-patch-id < patch";
+static const char patch_id_usage[] = "git patch-id < patch";
int main(int argc, char **argv)
{
diff --git a/unpack-file.c b/unpack-file.c
index bcdc8bb..75c5f51 100644
--- a/unpack-file.c
+++ b/unpack-file.c
@@ -26,7 +26,7 @@ int main(int argc, char **argv)
unsigned char sha1[20];
if (argc != 2)
- usage("git-unpack-file <sha1>");
+ usage("git unpack-file <sha1>");
if (get_sha1(argv[1], sha1))
die("Not a valid object name %s", argv[1]);
diff --git a/upload-pack.c b/upload-pack.c
index e5adbc0..24ab49d 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -11,7 +11,7 @@
#include "list-objects.h"
#include "run-command.h"
-static const char upload_pack_usage[] = "git-upload-pack [--strict] [--timeout=nn] <dir>";
+static const char upload_pack_usage[] = "git upload-pack [--strict] [--timeout=nn] <dir>";
/* bits #0..7 in revision.h, #8..10 in commit.c */
#define THEY_HAVE (1u << 11)
--
1.6.0.6
^ permalink raw reply related
* [PATCH] remove trailing '\n's in 'die' macros
From: Alexander Potashev @ 2009-01-04 18:38 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Git Mailing List, Alexander Potashev
'\n's in the end of format strings given to 'die' are redundant because
die uses error reporting function like 'static void report(const char
*prefix, const char *err, va_list params)' which always adds a '\n'.
Signed-off-by: Alexander Potashev <aspotashev@gmail.com>
---
builtin-cat-file.c | 2 +-
builtin-clone.c | 14 +++++++-------
builtin-fetch.c | 2 +-
builtin-init-db.c | 2 +-
builtin-log.c | 2 +-
builtin-mailinfo.c | 2 +-
builtin-merge-recursive.c | 2 +-
builtin-update-index.c | 2 +-
connect.c | 2 +-
daemon.c | 2 +-
diff.c | 2 +-
git.c | 2 +-
grep.c | 2 +-
imap-send.c | 6 +++---
index-pack.c | 2 +-
pack-redundant.c | 8 ++++----
16 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/builtin-cat-file.c b/builtin-cat-file.c
index 30d00a6..8fad19d 100644
--- a/builtin-cat-file.c
+++ b/builtin-cat-file.c
@@ -137,7 +137,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name)
break;
default:
- die("git cat-file: unknown option: %s\n", exp_type);
+ die("git cat-file: unknown option: %s", exp_type);
}
if (!buf)
diff --git a/builtin-clone.c b/builtin-clone.c
index 2feac9c..f1a1a0c 100644
--- a/builtin-clone.c
+++ b/builtin-clone.c
@@ -192,15 +192,15 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)
dir = opendir(src->buf);
if (!dir)
- die("failed to open %s\n", src->buf);
+ die("failed to open %s", src->buf);
if (mkdir(dest->buf, 0777)) {
if (errno != EEXIST)
- die("failed to create directory %s\n", dest->buf);
+ die("failed to create directory %s", dest->buf);
else if (stat(dest->buf, &buf))
- die("failed to stat %s\n", dest->buf);
+ die("failed to stat %s", dest->buf);
else if (!S_ISDIR(buf.st_mode))
- die("%s exists and is not a directory\n", dest->buf);
+ die("%s exists and is not a directory", dest->buf);
}
strbuf_addch(src, '/');
@@ -224,16 +224,16 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)
}
if (unlink(dest->buf) && errno != ENOENT)
- die("failed to unlink %s\n", dest->buf);
+ die("failed to unlink %s", dest->buf);
if (!option_no_hardlinks) {
if (!link(src->buf, dest->buf))
continue;
if (option_local)
- die("failed to create link %s\n", dest->buf);
+ die("failed to create link %s", dest->buf);
option_no_hardlinks = 1;
}
if (copy_file(dest->buf, src->buf, 0666))
- die("failed to copy file to %s\n", dest->buf);
+ die("failed to copy file to %s", dest->buf);
}
closedir(dir);
}
diff --git a/builtin-fetch.c b/builtin-fetch.c
index 7568163..de6f307 100644
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
@@ -607,7 +607,7 @@ static void set_option(const char *name, const char *value)
{
int r = transport_set_option(transport, name, value);
if (r < 0)
- die("Option \"%s\" value \"%s\" is not valid for %s\n",
+ die("Option \"%s\" value \"%s\" is not valid for %s",
name, value, transport->url);
if (r > 0)
warning("Option \"%s\" is ignored for %s\n",
diff --git a/builtin-init-db.c b/builtin-init-db.c
index d30c3fe..ee3911f 100644
--- a/builtin-init-db.c
+++ b/builtin-init-db.c
@@ -29,7 +29,7 @@ static void safe_create_dir(const char *dir, int share)
}
}
else if (share && adjust_shared_perm(dir))
- die("Could not make %s writable by group\n", dir);
+ die("Could not make %s writable by group", dir);
}
static void copy_templates_1(char *path, int baselen,
diff --git a/builtin-log.c b/builtin-log.c
index 99d1137..1fc1ae0 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -824,7 +824,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
committer = git_committer_info(IDENT_ERROR_ON_NO_NAME);
endpos = strchr(committer, '>');
if (!endpos)
- die("bogus committer info %s\n", committer);
+ die("bogus committer info %s", committer);
add_signoff = xmemdupz(committer, endpos - committer + 1);
}
else if (!strcmp(argv[i], "--attach")) {
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index e890f7a..f7c8c08 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -494,7 +494,7 @@ static void convert_to_utf8(struct strbuf *line, const char *charset)
return;
out = reencode_string(line->buf, metainfo_charset, charset);
if (!out)
- die("cannot convert from %s to %s\n",
+ die("cannot convert from %s to %s",
charset, metainfo_charset);
strbuf_attach(line, out, strlen(out), strlen(out));
}
diff --git a/builtin-merge-recursive.c b/builtin-merge-recursive.c
index 6b534c1..703045b 100644
--- a/builtin-merge-recursive.c
+++ b/builtin-merge-recursive.c
@@ -33,7 +33,7 @@ int cmd_merge_recursive(int argc, const char **argv, const char *prefix)
}
if (argc < 4)
- die("Usage: %s <base>... -- <head> <remote> ...\n", argv[0]);
+ die("Usage: %s <base>... -- <head> <remote> ...", argv[0]);
for (i = 1; i < argc; ++i) {
if (!strcmp(argv[i], "--"))
diff --git a/builtin-update-index.c b/builtin-update-index.c
index 65d5775..5604977 100644
--- a/builtin-update-index.c
+++ b/builtin-update-index.c
@@ -486,7 +486,7 @@ static int unresolve_one(const char *path)
static void read_head_pointers(void)
{
if (read_ref("HEAD", head_sha1))
- die("No HEAD -- no initial commit yet?\n");
+ die("No HEAD -- no initial commit yet?");
if (read_ref("MERGE_HEAD", merge_head_sha1)) {
fprintf(stderr, "Not in the middle of a merge.\n");
exit(0);
diff --git a/connect.c b/connect.c
index 2f55ad2..2f23ab3 100644
--- a/connect.c
+++ b/connect.c
@@ -315,7 +315,7 @@ static int git_tcp_connect_sock(char *host, int flags)
/* Not numeric */
struct servent *se = getservbyname(port,"tcp");
if ( !se )
- die("Unknown port %s\n", port);
+ die("Unknown port %s", port);
nport = se->s_port;
}
diff --git a/daemon.c b/daemon.c
index 60bf6c7..540700e 100644
--- a/daemon.c
+++ b/daemon.c
@@ -716,7 +716,7 @@ static int socksetup(char *listen_addr, int listen_port, int **socklist_p)
gai = getaddrinfo(listen_addr, pbuf, &hints, &ai0);
if (gai)
- die("getaddrinfo() failed: %s\n", gai_strerror(gai));
+ die("getaddrinfo() failed: %s", gai_strerror(gai));
for (ai = ai0; ai; ai = ai->ai_next) {
int sockfd;
diff --git a/diff.c b/diff.c
index 0484601..c159a5f 100644
--- a/diff.c
+++ b/diff.c
@@ -2039,7 +2039,7 @@ static void diff_fill_sha1_info(struct diff_filespec *one)
if (lstat(one->path, &st) < 0)
die("stat %s", one->path);
if (index_path(one->sha1, one->path, &st, 0))
- die("cannot hash %s\n", one->path);
+ die("cannot hash %s", one->path);
}
}
else
diff --git a/git.c b/git.c
index e0d9071..a53e24f 100644
--- a/git.c
+++ b/git.c
@@ -158,7 +158,7 @@ static int handle_alias(int *argcp, const char ***argv)
if (ret >= 0 && WIFEXITED(ret) &&
WEXITSTATUS(ret) != 127)
exit(WEXITSTATUS(ret));
- die("Failed to run '%s' when expanding alias '%s'\n",
+ die("Failed to run '%s' when expanding alias '%s'",
alias_string + 1, alias_command);
}
count = split_cmdline(alias_string, &new_argv);
diff --git a/grep.c b/grep.c
index 600f69f..49e9319 100644
--- a/grep.c
+++ b/grep.c
@@ -395,7 +395,7 @@ static int match_expr_eval(struct grep_opt *o,
h |= match_expr_eval(o, x->u.binary.right, bol, eol, ctx, 1);
break;
default:
- die("Unexpected node type (internal error) %d\n", x->node);
+ die("Unexpected node type (internal error) %d", x->node);
}
if (collect_hits)
x->hit |= h;
diff --git a/imap-send.c b/imap-send.c
index 3703dbd..c3fa0df 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -115,9 +115,9 @@ static int nfvasprintf(char **strp, const char *fmt, va_list ap)
len = vsnprintf(tmp, sizeof(tmp), fmt, ap);
if (len < 0)
- die("Fatal: Out of memory\n");
+ die("Fatal: Out of memory");
if (len >= sizeof(tmp))
- die("imap command overflow !\n");
+ die("imap command overflow!");
*strp = xmemdupz(tmp, len);
return len;
}
@@ -482,7 +482,7 @@ static int nfsnprintf(char *buf, int blen, const char *fmt, ...)
va_start(va, fmt);
if (blen <= 0 || (unsigned)(ret = vsnprintf(buf, blen, fmt, va)) >= (unsigned)blen)
- die("Fatal: buffer too small. Please report a bug.\n");
+ die("Fatal: buffer too small. Please report a bug.");
va_end(va);
return ret;
}
diff --git a/index-pack.c b/index-pack.c
index 60ed41a..2931511 100644
--- a/index-pack.c
+++ b/index-pack.c
@@ -178,7 +178,7 @@ static char *open_pack_file(char *pack_name)
} else
output_fd = open(pack_name, O_CREAT|O_EXCL|O_RDWR, 0600);
if (output_fd < 0)
- die("unable to create %s: %s\n", pack_name, strerror(errno));
+ die("unable to create %s: %s", pack_name, strerror(errno));
pack_fd = output_fd;
} else {
input_fd = open(pack_name, O_RDONLY);
diff --git a/pack-redundant.c b/pack-redundant.c
index 25b81a4..e93eb96 100644
--- a/pack-redundant.c
+++ b/pack-redundant.c
@@ -463,7 +463,7 @@ static void minimize(struct pack_list **min)
pll_free(perm_all);
}
if (perm_ok == NULL)
- die("Internal error: No complete sets found!\n");
+ die("Internal error: No complete sets found!");
/* find the permutation with the smallest size */
perm = perm_ok;
@@ -573,14 +573,14 @@ static struct pack_list * add_pack_file(char *filename)
struct packed_git *p = packed_git;
if (strlen(filename) < 40)
- die("Bad pack filename: %s\n", filename);
+ die("Bad pack filename: %s", filename);
while (p) {
if (strstr(p->pack_name, filename))
return add_pack(p);
p = p->next;
}
- die("Filename %s not found in packed_git\n", filename);
+ die("Filename %s not found in packed_git", filename);
}
static void load_all(void)
@@ -636,7 +636,7 @@ int main(int argc, char **argv)
add_pack_file(*(argv + i++));
if (local_packs == NULL)
- die("Zero packs found!\n");
+ die("Zero packs found!");
load_all_objects();
--
1.6.0.6
^ permalink raw reply related
* Re: git-branch --print-current
From: Adeodato Simó @ 2009-01-04 18:02 UTC (permalink / raw)
To: Karl Chen; +Cc: Arnaud Lacombe, Git mailing list
In-Reply-To: <quack.20090104T0440.lthbpun1bxo@roar.cs.berkeley.edu>
* Karl Chen [Sun, 04 Jan 2009 04:40:51 -0800]:
> Arnaud> $ git branch | awk '/^\*/ {print $2}'
> Yet another addition to the list of ways to pipeline it, this one
> probably the shortest :)
Heh, if we're playing golf:
$ git branch | sed -n 's/^\* //p'
--
Adeodato Simó dato at net.com.org.es
Debian Developer adeodato at debian.org
Que no te vendan amor sin espinas
-- Joaquín Sabina, Noches de boda
^ permalink raw reply
* Re: [PATCH next] git-cherry usage: correct nesting of commit-ish options
From: Markus Heidelberg @ 2009-01-04 18:01 UTC (permalink / raw)
To: Miklos Vajna; +Cc: gitster, git
In-Reply-To: <20090104173559.GG21154@genesis.frugalware.org>
Miklos Vajna, 04.01.2009:
> On Sun, Jan 04, 2009 at 05:11:22PM +0100, Markus Heidelberg <markus.heidelberg@web.de> wrote:
> > Another question: should this patch be split up into two, one for
> > maint/master and another for next?
>
> AFAIK sending patches against next is not preferred at all.
>From Documentation/SubmittingPatches:
If you are preparing a work based on "next" branch,
that is fine, but please mark it as such.
I guess the only reason is a required dependency not available in
'master'.
> You should
> send your patches against master, or - if you have a strong reason - on
> top of a given topic branch.
This patch depends on a commit in 'next'. But right, I could have
mentioned that it's against 'mh/cherry-default' as Junio suggested a few
days ago.
^ permalink raw reply
* Re: git-branch --print-current
From: Arnaud Lacombe @ 2009-01-04 17:55 UTC (permalink / raw)
To: demerphq; +Cc: Karl Chen, Git mailing list
In-Reply-To: <9b18b3110901040449x65c63d6fo3d9fec9ddd5670c@mail.gmail.com>
Hi,
On Sun, Jan 4, 2009 at 7:49 AM, demerphq <demerphq@gmail.com> wrote:
> 2009/1/4 Karl Chen <quarl@cs.berkeley.edu>:
>> On 2009-01-04 00:21 PST, Arnaud Lacombe writes:
>> Arnaud> $ git branch | awk '/^\*/ {print $2}'
>>
>> Yet another addition to the list of ways to pipeline it, this one
>> probably the shortest :)
>
> Unfortunately it doesnt work well when you arent on a branch:
>
> $ git branch | awk '/^\*/ {print $2}'
> (no
>
> So far two apparently expert git people have given solutions to this
> problem that don't elegantly handle the edge cases.
>
my bad:
$ git branch | awk '/^\*/ {print substr($0, 3)}'
- Arnaud
^ permalink raw reply
* Re: [PATCH next] git-cherry usage: correct nesting of commit-ish options
From: Miklos Vajna @ 2009-01-04 17:35 UTC (permalink / raw)
To: Markus Heidelberg; +Cc: gitster, git
In-Reply-To: <200901041711.23026.markus.heidelberg@web.de>
[-- Attachment #1: Type: text/plain, Size: 493 bytes --]
On Sun, Jan 04, 2009 at 05:11:22PM +0100, Markus Heidelberg <markus.heidelberg@web.de> wrote:
> Another question: should this patch be split up into two, one for
> maint/master and another for next?
AFAIK sending patches against next is not preferred at all. You should
send your patches against master, or - if you have a strong reason - on
top of a given topic branch.
In the later case I just use to write "This applies on top of
'xx/foo-bar'." between the three dashes and the diffstat.
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: [PATCH v2 resend] git.c: make autocorrected aliases work
From: Alexander Potashev @ 2009-01-04 17:28 UTC (permalink / raw)
To: Adeodato Simó; +Cc: git, gitster
In-Reply-To: <1231089361-12619-1-git-send-email-dato@net.com.org.es>
On 18:16 Sun 04 Jan , Adeodato Simó wrote:
> help_unknown_cmd() is able to autocorrect a command to an alias, and not
> only to internal or external commands. However, main() was not passing the
> autocorrected command through handle_alias(), hence it failed if it was an
> alias.
>
> This commit makes the autocorrected command go through handle_alias(), once
> handle_internal_command() and execv_dashed_external() have been tried. Since
> this is done twice in main() now, moved that logic to a new run_argv()
> function.
>
> Also, print the same "Expansion of alias 'x' failed" message when the alias
> was autocorrected, rather than a generic "Failed to run command 'x'".
>
> Signed-off-by: Adeodato Simó <dato@net.com.org.es>
> ---
>
> Meh, I didn't realize that by attaching an incremental diff, I'd break
> `git am`. Sorry about that.
>
> git.c | 53 +++++++++++++++++++++++++++++++++--------------------
> 1 files changed, 33 insertions(+), 20 deletions(-)
>
> diff --git a/git.c b/git.c
> index e0d9071..ee331aa 100644
> --- a/git.c
> +++ b/git.c
> @@ -416,12 +416,34 @@ static void execv_dashed_external(const char **argv)
> strbuf_release(&cmd);
> }
>
> +static int run_argv(int *argcp, const char ***argv)
> +{
> + int done_alias = 0;
> +
> + while (1) {
> + /* See if it's an internal command */
> + handle_internal_command(*argcp, *argv);
> +
> + /* .. then try the external ones */
> + execv_dashed_external(*argv);
> +
> + /* It could be an alias -- this works around the insanity
> + * of overriding "git log" with "git show" by having
> + * alias.log = show
> + */
> + if (done_alias || !handle_alias(argcp, argv))
> + break;
> + done_alias = 1;
> + }
> +
> + return done_alias;
> +}
> +
>
> int main(int argc, const char **argv)
> {
> const char *cmd = argv[0] && *argv[0] ? argv[0] : "git-help";
> char *slash = (char *)cmd + strlen(cmd);
> - int done_alias = 0;
>
> /*
> * Take the basename of argv[0] as the command
> @@ -479,31 +501,22 @@ int main(int argc, const char **argv)
> setup_path();
>
> while (1) {
> - /* See if it's an internal command */
> - handle_internal_command(argc, argv);
> -
> - /* .. then try the external ones */
> - execv_dashed_external(argv);
> -
> - /* It could be an alias -- this works around the insanity
> - * of overriding "git log" with "git show" by having
> - * alias.log = show
> - */
> - if (done_alias || !handle_alias(&argc, &argv))
> + static int done_help = 0;
> + static int was_alias = 0;
> + was_alias = run_argv(&argc, &argv);
> + if (errno != ENOENT)
> break;
> - done_alias = 1;
> - }
> -
> - if (errno == ENOENT) {
> - if (done_alias) {
> + if (was_alias) {
> fprintf(stderr, "Expansion of alias '%s' failed; "
> "'%s' is not a git-command\n",
> cmd, argv[0]);
> exit(1);
Why not using 'die' here?
die("Expansion of alias '%s' failed;
'%s' is not a git-command",
cmd, argv[0]);
DISCLAIMER: I have never used git's 'die'
> }
> - argv[0] = help_unknown_cmd(cmd);
> - handle_internal_command(argc, argv);
> - execv_dashed_external(argv);
> + if (!done_help) {
> + cmd = argv[0] = help_unknown_cmd(cmd);
> + done_help = 1;
> + } else
> + break;
> }
>
> fprintf(stderr, "Failed to run command '%s': %s\n",
> --
> 1.6.1.62.g677ca
^ permalink raw reply
* [PATCH v2 resend] git.c: make autocorrected aliases work
From: Adeodato Simó @ 2009-01-04 17:16 UTC (permalink / raw)
To: git, gitster; +Cc: Adeodato Simó
In-Reply-To: <1231089128-12066-1-git-send-email-dato@net.com.org.es>
help_unknown_cmd() is able to autocorrect a command to an alias, and not
only to internal or external commands. However, main() was not passing the
autocorrected command through handle_alias(), hence it failed if it was an
alias.
This commit makes the autocorrected command go through handle_alias(), once
handle_internal_command() and execv_dashed_external() have been tried. Since
this is done twice in main() now, moved that logic to a new run_argv()
function.
Also, print the same "Expansion of alias 'x' failed" message when the alias
was autocorrected, rather than a generic "Failed to run command 'x'".
Signed-off-by: Adeodato Simó <dato@net.com.org.es>
---
Meh, I didn't realize that by attaching an incremental diff, I'd break
`git am`. Sorry about that.
git.c | 53 +++++++++++++++++++++++++++++++++--------------------
1 files changed, 33 insertions(+), 20 deletions(-)
diff --git a/git.c b/git.c
index e0d9071..ee331aa 100644
--- a/git.c
+++ b/git.c
@@ -416,12 +416,34 @@ static void execv_dashed_external(const char **argv)
strbuf_release(&cmd);
}
+static int run_argv(int *argcp, const char ***argv)
+{
+ int done_alias = 0;
+
+ while (1) {
+ /* See if it's an internal command */
+ handle_internal_command(*argcp, *argv);
+
+ /* .. then try the external ones */
+ execv_dashed_external(*argv);
+
+ /* It could be an alias -- this works around the insanity
+ * of overriding "git log" with "git show" by having
+ * alias.log = show
+ */
+ if (done_alias || !handle_alias(argcp, argv))
+ break;
+ done_alias = 1;
+ }
+
+ return done_alias;
+}
+
int main(int argc, const char **argv)
{
const char *cmd = argv[0] && *argv[0] ? argv[0] : "git-help";
char *slash = (char *)cmd + strlen(cmd);
- int done_alias = 0;
/*
* Take the basename of argv[0] as the command
@@ -479,31 +501,22 @@ int main(int argc, const char **argv)
setup_path();
while (1) {
- /* See if it's an internal command */
- handle_internal_command(argc, argv);
-
- /* .. then try the external ones */
- execv_dashed_external(argv);
-
- /* It could be an alias -- this works around the insanity
- * of overriding "git log" with "git show" by having
- * alias.log = show
- */
- if (done_alias || !handle_alias(&argc, &argv))
+ static int done_help = 0;
+ static int was_alias = 0;
+ was_alias = run_argv(&argc, &argv);
+ if (errno != ENOENT)
break;
- done_alias = 1;
- }
-
- if (errno == ENOENT) {
- if (done_alias) {
+ if (was_alias) {
fprintf(stderr, "Expansion of alias '%s' failed; "
"'%s' is not a git-command\n",
cmd, argv[0]);
exit(1);
}
- argv[0] = help_unknown_cmd(cmd);
- handle_internal_command(argc, argv);
- execv_dashed_external(argv);
+ if (!done_help) {
+ cmd = argv[0] = help_unknown_cmd(cmd);
+ done_help = 1;
+ } else
+ break;
}
fprintf(stderr, "Failed to run command '%s': %s\n",
--
1.6.1.62.g677ca
^ permalink raw reply related
* [PATCH v2] git.c: make autocorrected aliases work
From: Adeodato Simó @ 2009-01-04 17:12 UTC (permalink / raw)
To: git, gitster; +Cc: Adeodato Simó
In-Reply-To: <1231088899-11943-1-git-send-email-dato@net.com.org.es>
help_unknown_cmd() is able to autocorrect a command to an alias, and not
only to internal or external commands. However, main() was not passing the
autocorrected command through handle_alias(), hence it failed if it was an
alias.
This commit makes the autocorrected command go through handle_alias(), once
handle_internal_command() and execv_dashed_external() have been tried. Since
this is done twice in main() now, moved that logic to a new run_argv()
function.
Also, print the same "Expansion of alias 'x' failed" message when the alias
was autocorrected, rather than a generic "Failed to run command 'x'".
Signed-off-by: Adeodato Simó <dato@net.com.org.es>
---
Here's a version of the patch that improves the error reporting, in case
this is desired. With the previous patch 'aliasx' -> 'alias' -> 'enoent'
printed "Failed to run command 'aliasx'", now it correctly prints
"Expansion of alias 'alias' failed: 'enoent' is not a git-command".
This is the incremental diff:
diff -u b/git.c b/git.c
--- b/git.c
+++ b/git.c
@@ -444,7 +444,6 @@
{
const char *cmd = argv[0] && *argv[0] ? argv[0] : "git-help";
char *slash = (char *)cmd + strlen(cmd);
- int was_alias = 0;
/*
* Take the basename of argv[0] as the command
@@ -501,17 +500,23 @@
*/
setup_path();
- was_alias = run_argv(&argc, &argv);
-
- if (errno == ENOENT) {
+ while (1) {
+ static int done_help = 0;
+ static int was_alias = 0;
+ was_alias = run_argv(&argc, &argv);
+ if (errno != ENOENT)
+ break;
if (was_alias) {
fprintf(stderr, "Expansion of alias '%s' failed; "
"'%s' is not a git-command\n",
cmd, argv[0]);
exit(1);
}
- argv[0] = help_unknown_cmd(cmd);
- run_argv(&argc, &argv);
+ if (!done_help) {
+ cmd = argv[0] = help_unknown_cmd(cmd);
+ done_help = 1;
+ } else
+ break;
}
fprintf(stderr, "Failed to run command '%s': %s\n",
git.c | 53 +++++++++++++++++++++++++++++++++--------------------
1 files changed, 33 insertions(+), 20 deletions(-)
diff --git a/git.c b/git.c
index e0d9071..ee331aa 100644
--- a/git.c
+++ b/git.c
@@ -416,12 +416,34 @@ static void execv_dashed_external(const char **argv)
strbuf_release(&cmd);
}
+static int run_argv(int *argcp, const char ***argv)
+{
+ int done_alias = 0;
+
+ while (1) {
+ /* See if it's an internal command */
+ handle_internal_command(*argcp, *argv);
+
+ /* .. then try the external ones */
+ execv_dashed_external(*argv);
+
+ /* It could be an alias -- this works around the insanity
+ * of overriding "git log" with "git show" by having
+ * alias.log = show
+ */
+ if (done_alias || !handle_alias(argcp, argv))
+ break;
+ done_alias = 1;
+ }
+
+ return done_alias;
+}
+
int main(int argc, const char **argv)
{
const char *cmd = argv[0] && *argv[0] ? argv[0] : "git-help";
char *slash = (char *)cmd + strlen(cmd);
- int done_alias = 0;
/*
* Take the basename of argv[0] as the command
@@ -479,31 +501,22 @@ int main(int argc, const char **argv)
setup_path();
while (1) {
- /* See if it's an internal command */
- handle_internal_command(argc, argv);
-
- /* .. then try the external ones */
- execv_dashed_external(argv);
-
- /* It could be an alias -- this works around the insanity
- * of overriding "git log" with "git show" by having
- * alias.log = show
- */
- if (done_alias || !handle_alias(&argc, &argv))
+ static int done_help = 0;
+ static int was_alias = 0;
+ was_alias = run_argv(&argc, &argv);
+ if (errno != ENOENT)
break;
- done_alias = 1;
- }
-
- if (errno == ENOENT) {
- if (done_alias) {
+ if (was_alias) {
fprintf(stderr, "Expansion of alias '%s' failed; "
"'%s' is not a git-command\n",
cmd, argv[0]);
exit(1);
}
- argv[0] = help_unknown_cmd(cmd);
- handle_internal_command(argc, argv);
- execv_dashed_external(argv);
+ if (!done_help) {
+ cmd = argv[0] = help_unknown_cmd(cmd);
+ done_help = 1;
+ } else
+ break;
}
fprintf(stderr, "Failed to run command '%s': %s\n",
--
1.6.1.62.g677ca
^ permalink raw reply related
* [PATCH] git.c: make autocorrected aliases work
From: Adeodato Simó @ 2009-01-04 17:08 UTC (permalink / raw)
To: git, gitster; +Cc: Adeodato Simó
help_unknown_cmd() is able to autocorrect a command to an alias, and not
only to internal or external commands. However, main() was not passing the
autocorrected command through handle_alias(), hence it failed if it was an
alias.
This commit makes the autocorrected command go through handle_alias, once
handle_internal_command() and execv_dashed_external() have been tried. Since
this is done twice in main() now, moved that logic to a new run_argv()
function.
Signed-off-by: Adeodato Simó <dato@net.com.org.es>
---
git.c | 46 +++++++++++++++++++++++++++-------------------
1 files changed, 27 insertions(+), 19 deletions(-)
diff --git a/git.c b/git.c
index e0d9071..f443b4c 100644
--- a/git.c
+++ b/git.c
@@ -416,12 +416,35 @@ static void execv_dashed_external(const char **argv)
strbuf_release(&cmd);
}
+static int run_argv(int *argcp, const char ***argv)
+{
+ int done_alias = 0;
+
+ while (1) {
+ /* See if it's an internal command */
+ handle_internal_command(*argcp, *argv);
+
+ /* .. then try the external ones */
+ execv_dashed_external(*argv);
+
+ /* It could be an alias -- this works around the insanity
+ * of overriding "git log" with "git show" by having
+ * alias.log = show
+ */
+ if (done_alias || !handle_alias(argcp, argv))
+ break;
+ done_alias = 1;
+ }
+
+ return done_alias;
+}
+
int main(int argc, const char **argv)
{
const char *cmd = argv[0] && *argv[0] ? argv[0] : "git-help";
char *slash = (char *)cmd + strlen(cmd);
- int done_alias = 0;
+ int was_alias = 0;
/*
* Take the basename of argv[0] as the command
@@ -478,32 +501,17 @@ int main(int argc, const char **argv)
*/
setup_path();
- while (1) {
- /* See if it's an internal command */
- handle_internal_command(argc, argv);
-
- /* .. then try the external ones */
- execv_dashed_external(argv);
-
- /* It could be an alias -- this works around the insanity
- * of overriding "git log" with "git show" by having
- * alias.log = show
- */
- if (done_alias || !handle_alias(&argc, &argv))
- break;
- done_alias = 1;
- }
+ was_alias = run_argv(&argc, &argv);
if (errno == ENOENT) {
- if (done_alias) {
+ if (was_alias) {
fprintf(stderr, "Expansion of alias '%s' failed; "
"'%s' is not a git-command\n",
cmd, argv[0]);
exit(1);
}
argv[0] = help_unknown_cmd(cmd);
- handle_internal_command(argc, argv);
- execv_dashed_external(argv);
+ run_argv(&argc, &argv);
}
fprintf(stderr, "Failed to run command '%s': %s\n",
--
1.6.1.62.g677ca
^ permalink raw reply related
* Re: [PATCH next] git-cherry usage: correct nesting of commit-ish options
From: Markus Heidelberg @ 2009-01-04 16:16 UTC (permalink / raw)
To: gitster; +Cc: git
In-Reply-To: <200901041711.23026.markus.heidelberg@web.de>
Markus Heidelberg, 04.01.2009:
>
> Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
> ---
>
> What is the preferred way to say the patch is against next? In the
> subject like this?
> Another question: should this patch be split up into two, one for
> maint/master and another for next?
For the second patch against next I meant it being based on origin/next
that already includes the extracted patch for maint/master.
^ permalink raw reply
* [PATCH next] git-cherry usage: correct nesting of commit-ish options
From: Markus Heidelberg @ 2009-01-04 16:11 UTC (permalink / raw)
To: gitster; +Cc: git
Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
---
What is the preferred way to say the patch is against next? In the
subject like this?
Another question: should this patch be split up into two, one for
maint/master and another for next?
Documentation/git-cherry.txt | 2 +-
builtin-log.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-cherry.txt b/Documentation/git-cherry.txt
index 556ea23..7deefda 100644
--- a/Documentation/git-cherry.txt
+++ b/Documentation/git-cherry.txt
@@ -7,7 +7,7 @@ git-cherry - Find commits not merged upstream
SYNOPSIS
--------
-'git cherry' [-v] [<upstream>] [<head>] [<limit>]
+'git cherry' [-v] [<upstream> [<head> [<limit>]]]
DESCRIPTION
-----------
diff --git a/builtin-log.c b/builtin-log.c
index 243f857..7e9616e 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -1071,7 +1071,7 @@ static int add_pending_commit(const char *arg, struct rev_info *revs, int flags)
}
static const char cherry_usage[] =
-"git cherry [-v] [<upstream>] [<head>] [<limit>]";
+"git cherry [-v] [<upstream> [<head> [<limit>]]]";
int cmd_cherry(int argc, const char **argv, const char *prefix)
{
struct rev_info revs;
--
1.6.1.35.g0c23
^ permalink raw reply related
* Re: [PATCH] gitweb: merge boolean feature subroutines
From: Matt Kraai @ 2009-01-04 15:58 UTC (permalink / raw)
To: demerphq; +Cc: Junio C Hamano, git
In-Reply-To: <9b18b3110901040341n5ff5fa09s878228131d11d2a6@mail.gmail.com>
On Sun, Jan 04, 2009 at 12:41:14PM +0100, demerphq wrote:
> Why execute more opcodes, and return a slightly surprising false, when
> you dont have to?
>
> Is it really deep perl magic to do:
>
> return $val eq 'true';
>
> instead of
>
> return $val eq 'true' ? 1 : 0;
>
> or the actual use:
>
> if ($val eq 'true') {
> return 1
> } else {
> return 0
> }
>
> Isn't the former superior just on pure minimalism metrics? Theres less
> code to understand, less code to go wrong, and as a bonus it returns a
> true boolean. Isn't that just a win-win-win? I mean most perl
> programmers I know would instantly convert the latter two to the first
> just on the grounds that the first version is the clearest expression
> of the desired intent.
I agree that what you suggest is better than the alternatives you
present. Unfortunately, none of them match the current behavior.
Here's the current code:
if ($val eq 'true') {
return 1;
} elsif ($val eq 'false') {
return 0;
}
return $_[0];
Is there a way to use the form you suggest while falling back to the
default if $val isn't set to 'true' or 'false'?
--
Matt http://ftbfs.org/
^ permalink raw reply
* [Q] post-commit hook to backup repo by emailing git bundle
From: Alexander Gladysh @ 2009-01-04 15:27 UTC (permalink / raw)
To: git
Hi, list!
I have a server, where I store my light-weight private data (a wiki
contents) inside a git repo. I need a backup solution for this data.
Setting up a mirror repository and fetching/pushing over the network
is highly uncomfortable for a number of reasons for this specific
case.
I'm thinking of setting up a post-commit hook on my wiki repo, which
would prepare git bundle for the commit and send it to me via e-mail.
Perhaps someone already has something like this, so I would not have
to reimplement the wheel?
Alexander.
^ permalink raw reply
* announce: TortoiseGit 0.2 preview released
From: Frank Li @ 2009-01-04 15:15 UTC (permalink / raw)
To: git, tortoisegit-announce
After heavy developing, TortoiseGit 0.2 preview release published.
TortoiseGit 0.2 can finish regular work, such as commit, show log,
diff version, create tag, create branch, create patchs.
Download:
http://code.google.com/p/tortoisegit/downloads/list
Version 0.2.0.0 preview version:
Features:
1. Add TortoisgeMerge as default compare tools
2. Pull, Fetch, Push
3. Create Branch\Tag
4. Switch branch \Chechout
5. Compare with previous version
6. Clone(only support local repository, see known issue for detail)
7. Log Dialog support filter
8. Check for modifications
9. Revert local change
10.Create Patch Serial
11.Apply Patch Serial
12.Add file to repository(see know issue)
13.Export to zip file
Bug Fix:
1. A2W cause stack overwrite bug when git output is long.
Known Issue:
1. ProcessDlg will wait for ever when clone remote repository(ssh, http,git).
2. push fetch and pull don't support password mode. Just support
public key problem.
3. Just fetch first 100 log item.
4. If install TortoiseGit before MsysGit, you need modify register
HKEY_LOCAL_MACHINE\Software\TortoiseGit\\MsysGit\
Let it point to correct msysgit install path.
5. Add File, please commit and show unversion file, the choose add
file, then right clict, Choose Add file
6. To new initial repository, You will not see add file again in
commit dialog box if give up commit when choose add
^ permalink raw reply
* Re: [PATCH rfc v2] git-sh-setup: Fix scripts whose PWD is a symlink to a work-dir on OS X
From: Wincent Colaiuta @ 2009-01-04 13:58 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Marcel M. Cary, git, jnareb, ae, j.sixt
In-Reply-To: <7v8wps59ss.fsf@gitster.siamese.dyndns.org>
El 3/1/2009, a las 23:01, Junio C Hamano escribió:
> "Marcel M. Cary" <marcel@oak.homeunix.org> writes:
>
>> I sent the first rev of this patch to just Brian. It didn't have
>> either of the unit test changes. He said it fixed all but t2300.3,
>> where cd_to_toplevel doesn't actually "cd", so I made the same change
>> to the unit test itself. Can someone with OS X try running the test
>> suite with v2 of this patch? I don't have OS X readily available.
>
> I think I saw a success report on the list. Care to resend it with
> Sign-off (by you) and
>
> Tested-by: tester <test@er.xz> (on PLATFORM)
>
> lines as you see necessary for application?
>
> Thanks.
I also tested it and can confirm that it fixes the failures on Mac OS
X 10.5.5. So feel free to add:
Tested-by: Wincent Colaiuta <win@wincent.com> (on Mac OS X 10.5.5)
Cheers,
Wincent
^ permalink raw reply
* Re: git-branch --print-current
From: demerphq @ 2009-01-04 13:35 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Karl Chen, Miklos Vajna, David Aguilar, Git mailing list
In-Reply-To: <7vzli73b1g.fsf@gitster.siamese.dyndns.org>
2009/1/4 Junio C Hamano <gitster@pobox.com>:
> Karl Chen <quarl@cs.berkeley.edu> writes:
>
>> For example: Google for how to add the name of the git branch to
>> the bash prompt and you'll find countless examples of people using
>> git-branch. And they're all different, so people aren't just
>> blindly copying one guy; here is a small sample:
>> ...
>> There were a few using git-symbolic-ref but most used git-branch.
>
> That is a good point about user education, and is a demonstration why a
> new option to cover a very narrow-special case to symbolic-ref will not
> help the situation. People will add their own embellishments around the
> name of the branch anyway, and the most generic symbolic-ref output is
> just as useful as a special case option to show without refs/heads/.
>
> What you quoted are all inferior implementations of showing the name of
> the current branch in the bash prompt. The most correct way (in the sense
> that it won't be broken in future git) is always found in the bash
> completion script in contrib/completion/git-completion.bash and it reads:
>
> PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
>
> You can of course change this to suit your taste. For example, here is a
> variant I personally use:
>
> PS1=': \h \W$(__git_ps1 "/%s"); '
>
> The point is that __git_ps1 shell function is defined to be used for this
> exact purpose and is documented in the completion script.
>
> Besides showing the current branch, it knows how to interpret the various
> state clues git operations leave in the repository and the work tree, and
> reminds them what you are in the middle of (e.g. applying patch series
> using "git am", rebasing interactively, resolving conflicts after a merge
> did not autoresolve, etc.), and also knows how to show the detached HEAD.
The version im using, from git version 1.6.0.4.724.ga0d3a produces the
following error:
cut: ./HEAD: No such file or directory
when in the .git/refs directory.
Cheers,
yves
--
perl -Mre=debug -e "/just|another|perl|hacker/"
^ permalink raw reply
* Re: [RFC/PATCH] git-web--browse: don't add start as candidate on Ubuntu
From: Petr Baudis @ 2009-01-04 13:29 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Christian Couder, Ramsay Jones, GIT Mailing-list
In-Reply-To: <7vljtr33sb.fsf@gitster.siamese.dyndns.org>
On Sat, Jan 03, 2009 at 11:53:56PM -0800, Junio C Hamano wrote:
> Christian Couder <chriscool@tuxfamily.org> writes:
>
> > Le jeudi 1 janvier 2009, Ramsay Jones a écrit :
> > ...
> >> Does anybody else see this issue and can someone test the patch?
> >
> > Petr, as you added support for using /bin/start on MinGW, could you test?
Sorry, I don't have access to MinGW system anymore.
> > diff --git a/git-web--browse.sh b/git-web--browse.sh
> > index 78d236b..7ed0fad 100755
> > --- a/git-web--browse.sh
> > +++ b/git-web--browse.sh
> > @@ -115,7 +115,7 @@ if test -z "$browser" ; then
> > browser_candidates="open $browser_candidates"
> > fi
> > # /bin/start indicates MinGW
> > - if test -n /bin/start; then
> > + if test -x /bin/start; then
> > browser_candidates="start $browser_candidates"
> > fi
>
> In any case, the original test is simply bogus. 'test -n "$foo"' is to
> see if $foo is an empty string, and giving a constant /bin/start always
> yields true.
Oops. :-) That should've obviously been -f.
--
Petr "Pasky" Baudis
The average, healthy, well-adjusted adult gets up at seven-thirty
in the morning feeling just terrible. -- Jean Kerr
^ permalink raw reply
* Re: a few Topgit patches
From: Uwe Kleine-König @ 2009-01-04 13:05 UTC (permalink / raw)
To: martin f krafft; +Cc: git, Petr Baudis
In-Reply-To: <20081226170334.GA18722@pengutronix.de>
Hi martin,
On Fri, Dec 26, 2008 at 06:03:34PM +0100, Uwe Kleine-König wrote:
> On Thu, Dec 25, 2008 at 03:58:34PM +0100, martin f krafft wrote:
> > also sprach Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [2008.12.23.1530 +0100]:
> > > I hacked using topgit for some time now, and found the following changes
> > > to topgit useful:
> > >
> > > Uwe Kleine-König (3):
> > > tg export: implement skipping empty patches for collapse driver
> > > tg export: Implement flattening patch paths for quilt mode
> > > tg export (quilt): Implement numbering the patches
> >
> > They all look good. I am a bit concerned about the use of
> > single-letter options at this stage. tg-export is bound to grow, and
> > using them all up now might mean breaking compatibility later, when
> > a more common option needs e.g. -f, which has already been taken.
> I updated my tree to make '-f' '--flatten'. IMHO -n is nice for getting
> numbered patches, but if you prefer, I will make this --numbered.
>
> Oh, and I just noticed that documentation is missing. I will fix this
> when I sent this mail.
This is done. Now I even changed '-n' to '--numbered' and changed the
commit log accordingly. Are there still concerns about my patches?
Should I resend the current version?
The patches are still available in my topgit repo at
git://git.pengutronix.de/git/ukl/topgit.git master
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Strasse 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply
* Re: git-branch --print-current
From: demerphq @ 2009-01-04 12:49 UTC (permalink / raw)
To: Karl Chen; +Cc: Arnaud Lacombe, Git mailing list
In-Reply-To: <quack.20090104T0440.lthbpun1bxo@roar.cs.berkeley.edu>
2009/1/4 Karl Chen <quarl@cs.berkeley.edu>:
>>>>>> On 2009-01-04 00:21 PST, Arnaud Lacombe writes:
>
> Arnaud> FWIW, I had this in a stalled modification in a tree,
> Arnaud> it just add the '-c' (as "current") option to git
> Arnaud> branch. Patch is mostly for the record :/
>
> Thanks, glad someone else wanted this too. If we modified
> git-symbolic-ref it would probably be less code since it doesn't
> have to loop over all branches, though from a UI perspective I
> still prefer git-branch. Anyway doesn't look like people like the
> idea so how about that git-rev-parse --symbolic-abbrev-name idea
> :)
FWIW: I like the idea. Ive always thought that a --current flag to git
branch was missing. IOW i should be able to do:
branch=`git branch --current`
and get back a usable branch name. I dont think one should need to
rely on awk or sed or scripts to find this out, if only for
portability reasons.
>
> Arnaud> The main trouble I have with pipe stuff is that it
> Arnaud> forks a process for something that can be done
> Arnaud> natively. Previously, I was using awk(1) to extract
> Arnaud> the current branch:
>
> Arnaud> $ git branch | awk '/^\*/ {print $2}'
>
> Yet another addition to the list of ways to pipeline it, this one
> probably the shortest :)
Unfortunately it doesnt work well when you arent on a branch:
$ git branch | awk '/^\*/ {print $2}'
(no
So far two apparently expert git people have given solutions to this
problem that don't elegantly handle the edge cases.
That seems to me to be a powerful argument that it is actually more
difficult to do than is being represented here on the list, and
deserves to be native level git functionality.
Cheers,
yves
--
perl -Mre=debug -e "/just|another|perl|hacker/"
^ permalink raw reply
* Re: git-branch --print-current
From: Karl Chen @ 2009-01-04 12:40 UTC (permalink / raw)
To: Arnaud Lacombe; +Cc: Git mailing list
In-Reply-To: <1a69a9d80901040021i1dae2c6j7337cf57eed6476a@mail.gmail.com>
>>>>> On 2009-01-04 00:21 PST, Arnaud Lacombe writes:
Arnaud> FWIW, I had this in a stalled modification in a tree,
Arnaud> it just add the '-c' (as "current") option to git
Arnaud> branch. Patch is mostly for the record :/
Thanks, glad someone else wanted this too. If we modified
git-symbolic-ref it would probably be less code since it doesn't
have to loop over all branches, though from a UI perspective I
still prefer git-branch. Anyway doesn't look like people like the
idea so how about that git-rev-parse --symbolic-abbrev-name idea
:)
Arnaud> The main trouble I have with pipe stuff is that it
Arnaud> forks a process for something that can be done
Arnaud> natively. Previously, I was using awk(1) to extract
Arnaud> the current branch:
Arnaud> $ git branch | awk '/^\*/ {print $2}'
Yet another addition to the list of ways to pipeline it, this one
probably the shortest :)
[BTW, your patch mime type was application/octet-stream :(]
^ permalink raw reply
* Re: git-rev-parse --symbolic-abbrev-name [was Re: git-branch --print-current]
From: demerphq @ 2009-01-04 12:40 UTC (permalink / raw)
To: Karl Chen; +Cc: Junio C Hamano, Miklos Vajna, David Aguilar, Git mailing list
In-Reply-To: <quack.20090104T0434.lthfxjz1c8x_-_@roar.cs.berkeley.edu>
2009/1/4 Karl Chen <quarl@cs.berkeley.edu>:
>>>>>> On 2009-01-03 21:17 PST, Junio C Hamano writes:
>
> Junio> That is a good point about user education, and is a
> Junio> demonstration why a new option to cover a very
> Junio> narrow-special case to symbolic-ref will not help the
> Junio> situation. People will add their own embellishments
> Junio> around the name of the branch anyway, and the most
> Junio> generic symbolic-ref output is just as useful as a
> Junio> special case option to show without refs/heads/.
>
> That's arguable :) you really think "branchfoo" instead of
> "refs/heads/branchfoo" is a narrow special case? Seems like a
> common case for everyone except plumbing tools.
I agree. All the scripting I've done involves using the non qualified form.
> Here's a more general idea you might like better:
>
> git symbolic-ref --abbrev BLAH
> or even
> git rev-parse --symbolic-abbrev-name BLAH
>
> This would be like git-rev-parse --symbolic-full-name, but strips
> the "refs/x/" iff the result is unambiguous. Since it's much more
> work for a script to check whether the stripped version is
> ambiguous, this functionality is appropriate as a builtin option.
I vote for this, I could and would use it many scripts. Also please
dont make it die if BLAH is not a symbolic ref if this option is used.
Just return nothing.
cheers,
Yves
--
perl -Mre=debug -e "/just|another|perl|hacker/"
^ 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