All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sverre Rabbelier <srabbelier@gmail.com>
To: Junio C Hamano <gitster@pobox.com>,
	Jonathan Nieder <jrnieder@gmail.com>, Jeff King <peff@peff.net>,
	Git List <git@vger.kernel.org>,
	Daniel Barkalow <barkalow@iabervon.org>,
	Ramkumar
Cc: Sverre Rabbelier <srabbelier@gmail.com>
Subject: [PATCH 3/5] setup_revisions: remember whether a ref was positive or not
Date: Sun, 24 Jul 2011 16:21:20 +0200	[thread overview]
Message-ID: <1311517282-24831-4-git-send-email-srabbelier@gmail.com> (raw)
In-Reply-To: <1311517282-24831-1-git-send-email-srabbelier@gmail.com>

From: Johannes Schindelin <Johannes.Schindelin@gmx.de>

This will be required by fast-export, when no commits were
exported, but the refs should be set, of course.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
---

  This is just in preperation of fixing the actual bug.

 object.h   |    2 +-
 revision.c |   12 +++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/object.h b/object.h
index b6618d9..a28cd45 100644
--- a/object.h
+++ b/object.h
@@ -12,7 +12,7 @@ struct object_array {
 	struct object_array_entry {
 		struct object *item;
 		const char *name;
-		unsigned mode;
+		unsigned mode, flags;
 	} *objects;
 };
 
diff --git a/revision.c b/revision.c
index c46cfaa..72c3ee5 100644
--- a/revision.c
+++ b/revision.c
@@ -131,7 +131,7 @@ void mark_parents_uninteresting(struct commit *commit)
 	}
 }
 
-static void add_pending_object_with_mode(struct rev_info *revs, struct object *obj, const char *name, unsigned mode)
+static void add_pending_object_with_mode(struct rev_info *revs, struct object *obj, const char *name, unsigned mode, unsigned flags)
 {
 	if (!obj)
 		return;
@@ -152,11 +152,12 @@ static void add_pending_object_with_mode(struct rev_info *revs, struct object *o
 			return;
 	}
 	add_object_array_with_mode(obj, name, &revs->pending, mode);
+	revs->pending.objects[revs->pending.nr-1].flags = flags;
 }
 
 void add_pending_object(struct rev_info *revs, struct object *obj, const char *name)
 {
-	add_pending_object_with_mode(revs, obj, name, S_IFINVALID);
+	add_pending_object_with_mode(revs, obj, name, S_IFINVALID, 0);
 }
 
 void add_head_to_pending(struct rev_info *revs)
@@ -1073,7 +1074,8 @@ int handle_revision_arg(const char *arg, struct rev_info *revs,
 			} else
 				a->object.flags |= flags_exclude;
 			b->object.flags |= flags;
-			add_pending_object(revs, &a->object, this);
+			add_pending_object_with_mode(revs, &a->object, this,
+						     S_IFINVALID, flags_exclude);
 			add_pending_object(revs, &b->object, next);
 			return 0;
 		}
@@ -1103,7 +1105,7 @@ int handle_revision_arg(const char *arg, struct rev_info *revs,
 	if (!cant_be_filename)
 		verify_non_filename(revs->prefix, arg);
 	object = get_reference(revs, arg, sha1, flags ^ local_flags);
-	add_pending_object_with_mode(revs, object, arg, mode);
+	add_pending_object_with_mode(revs, object, arg, mode, local_flags);
 	return 0;
 }
 
@@ -1708,7 +1710,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
 		if (get_sha1_with_mode(revs->def, sha1, &mode))
 			die("bad default revision '%s'", revs->def);
 		object = get_reference(revs, revs->def, sha1, 0);
-		add_pending_object_with_mode(revs, object, revs->def, mode);
+		add_pending_object_with_mode(revs, object, revs->def, mode, 0);
 	}
 
 	/* Did the user ask for any diff output? Run the diff! */
-- 
1.7.6.385.g91185.dirty

  parent reply	other threads:[~2011-07-24 14:22 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-24 14:21 [PATCH 0/5] fast-export: prepare for remote helpers awesomeness Sverre Rabbelier
2011-07-24 14:21 ` [PATCH 1/5] t9350: point out that refs are not updated correctly Sverre Rabbelier
2011-07-24 14:21 ` [PATCH 2/5] fast-export: do not refer to non-existing marks Sverre Rabbelier
2011-07-24 14:21 ` Sverre Rabbelier [this message]
2011-07-24 19:23   ` [PATCH 3/5] setup_revisions: remember whether a ref was positive or not Junio C Hamano
2011-07-24 23:17     ` Junio C Hamano
2011-08-03 13:52       ` Sverre Rabbelier
2011-08-03 18:12         ` Junio C Hamano
2011-08-08 16:22           ` Johannes Schindelin
2011-08-08 17:47             ` Junio C Hamano
2011-08-08 21:27               ` Sverre Rabbelier
2011-08-08 22:07                 ` Junio C Hamano
2011-08-08 22:30                   ` Sverre Rabbelier
2011-08-08 22:36                     ` Junio C Hamano
2011-08-08 22:38                       ` Sverre Rabbelier
2011-08-08 22:46                         ` Junio C Hamano
2011-08-08 22:48                           ` Sverre Rabbelier
2011-08-08 23:17                             ` Junio C Hamano
2011-08-08 23:25                               ` Sverre Rabbelier
2011-08-08 23:39                                 ` Junio C Hamano
2011-08-08 22:24                 ` Junio C Hamano
2011-08-08 22:28                   ` Sverre Rabbelier
2011-08-08 22:56                     ` Junio C Hamano
2011-08-08 23:04                       ` Sverre Rabbelier
2011-07-26 15:16     ` Johannes Schindelin
2011-07-24 14:21 ` [PATCH 4/5] fast-export: do not export negative refs Sverre Rabbelier
2011-07-24 19:07   ` Junio C Hamano
2011-07-26 15:11     ` Johannes Schindelin
2011-07-24 14:21 ` [PATCH 5/5] setup_revisions: remember whether a ref was positive or not Sverre Rabbelier

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=1311517282-24831-4-git-send-email-srabbelier@gmail.com \
    --to=srabbelier@gmail.com \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=peff@peff.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.