From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Marc Singer <elf@buici.com>, git@vger.kernel.org
Subject: Re: Bootstrapping into git, commit gripes at me
Date: Mon, 11 Jul 2005 16:15:31 -0700 [thread overview]
Message-ID: <7v8y0dndd8.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <7vll4dndwu.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Mon, 11 Jul 2005 16:03:45 -0700")
Junio C Hamano <junkio@cox.net> writes:
>
> - git-commit-tree says check_valid("commit") and barfs.
>
> My current preference is to keep .git/refs/heads tag free. At
> least, I do not think we should ever write non commits to
> .git/*_HEAD.
>
> What do you think? An alternative would be to allow tags
> (recursively) pointing at a commit as a commit parent, but I do
> not think we would want to go that route.
Or, just dereferencing tags for commit parents in commit-tree
would be fine as well.
------------
Dereference tags given as commit-tree -p parameters.
Marc Singer noticed that when he has a tag instead of a commit
in his .git/HEAD (this happens after git checkout -f <tag>), git
commit barfs. This patch makes commit-tree dereference tags
like everybody else does.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
cd /opt/packrat/playpen/public/in-place/git/git.junio/
jit-diff
# - master: [PATCH] git-cvsimport-script: add "import only" option
# + (working tree)
diff --git a/commit-tree.c b/commit-tree.c
--- a/commit-tree.c
+++ b/commit-tree.c
@@ -8,6 +8,7 @@
#include <pwd.h>
#include <time.h>
#include <ctype.h>
+#include "commit.h"
#define BLOCKING (1ul << 14)
@@ -133,10 +134,14 @@ int main(int argc, char **argv)
check_valid(tree_sha1, "tree");
for (i = 2; i < argc; i += 2) {
char *a, *b;
+ struct commit *commit;
a = argv[i]; b = argv[i+1];
if (!b || strcmp(a, "-p") || get_sha1(b, parent_sha1[parents]))
usage(commit_tree_usage);
- check_valid(parent_sha1[parents], "commit");
+ commit = lookup_commit_reference(parent_sha1[parents]);
+ if (!commit)
+ usage(commit_tree_usage);
+ memcpy(parent_sha1[parents], commit->object.sha1, 20);
if (new_parent(parents))
parents++;
}
Compilation finished at Mon Jul 11 16:12:36
next prev parent reply other threads:[~2005-07-11 23:20 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-08 23:07 Bootstrapping into git, commit gripes at me Marc Singer
[not found] ` <7v4qb46dff.fsf@assigned-by-dhcp.cox.net>
2005-07-09 1:11 ` Marc Singer
2005-07-09 21:04 ` Matthias Urlichs
2005-07-10 15:06 ` Petr Baudis
[not found] ` <20050709003636.GA26526@buici.com>
[not found] ` <7v1x684wgr.fsf@assigned-by-dhcp.cox.net>
2005-07-09 1:16 ` Marc Singer
2005-07-09 1:31 ` Junio C Hamano
2005-07-09 1:43 ` Linus Torvalds
2005-07-11 22:20 ` Marc Singer
2005-07-11 23:03 ` Junio C Hamano
2005-07-11 23:15 ` Junio C Hamano [this message]
2005-07-12 0:57 ` Linus Torvalds
2005-07-12 1:43 ` Linus Torvalds
2005-07-12 2:10 ` Marc Singer
2005-07-12 3:09 ` Linus Torvalds
2005-07-12 3:49 ` Linus Torvalds
2005-07-12 4:34 ` Linus Torvalds
2005-07-12 4:43 ` Marc Singer
2005-07-12 4:59 ` Linus Torvalds
2005-07-12 5:12 ` Marc Singer
2005-07-12 7:48 ` Petr Baudis
2005-07-12 9:07 ` Junio C Hamano
2005-07-12 16:29 ` Matthias Urlichs
2005-07-24 8:57 ` Petr Baudis
2005-07-24 16:24 ` Junio C Hamano
2005-07-12 16:48 ` Linus Torvalds
2005-08-12 1:26 ` Petr Baudis
2005-07-12 2:21 ` Junio C Hamano
2005-07-12 3:18 ` Linus Torvalds
2005-07-12 3:41 ` Junio C Hamano
2005-07-12 3:52 ` Linus Torvalds
2005-07-12 3:53 ` Marc Singer
2005-07-12 17:04 ` Daniel Barkalow
2005-07-11 23:45 ` Linus Torvalds
-- strict thread matches above, loose matches on Subject: below --
2005-07-09 0:40 Marc Singer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7v8y0dndd8.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=elf@buici.com \
--cc=git@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).