All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Marco Costalba <mcostalba@gmail.com>,
	Paul Mackerras <paulus@samba.org>,
	git@vger.kernel.org
Subject: Re: [PATCH 2/2] Support "history replay" for git log commands
Date: Fri, 02 Nov 2007 14:05:11 -0700	[thread overview]
Message-ID: <7v4pg41hq0.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <alpine.LFD.0.999.0711021333050.3342@woody.linux-foundation.org> (Linus Torvalds's message of "Fri, 2 Nov 2007 13:35:17 -0700 (PDT)")

Linus Torvalds <torvalds@linux-foundation.org> writes:

> This notices if we aren't in topological order, and replays the history. 
> Thus avoiding the need to sort history up front.
>     
> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> ---
>
> See the code and the more complete explanations in [PATCH 0/2]. In 
> particular, see the last section there about the downsides of this: the 
> 50x expansion of output on the kernel is unacceptable, but if somebody can 
> make a graphical viewer that can react correctly to the "Replay" thing, 
> I'm sure I can make the replays themselves happen much more rarely.
>
>  builtin-blame.c |    2 +-
>  builtin-log.c   |   35 +++++++++++++++++++++++++++++++++++
>  log-tree.c      |   10 +++++++---
>  revision.c      |   29 ++++++++++++++++++++++-------
>  revision.h      |    6 +++++-
>  5 files changed, 70 insertions(+), 12 deletions(-)
>
> diff --git a/builtin-blame.c b/builtin-blame.c
> index 8432b82..7b6af8c 100644
> --- a/builtin-blame.c
> +++ b/builtin-blame.c
> @@ -1502,7 +1502,7 @@ static void assign_blame(struct scoreboard *sb, struct rev_info *revs, int opt)
>  		else {
>  			commit->object.flags |= UNINTERESTING;
>  			if (commit->object.parsed)
> -				mark_parents_uninteresting(commit);
> +				mark_parents_uninteresting(revs, commit);
>  		}
>  		/* treat root commit as boundary */
>  		if (!commit->parents && !show_root)
> diff --git a/builtin-log.c b/builtin-log.c
> index e8b982d..10e0821 100644
> --- a/builtin-log.c
> +++ b/builtin-log.c
> @@ -77,6 +77,35 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
>  	}
>  }
>  
> +static void replay_history(struct rev_info *revs)
> +{
> +	struct commit_list *entry;
> +
> +	revs->trigger_replay = 0;
> +	while ((entry = revs->shown) != NULL) {
> +		struct commit *commit = entry->item;
> +		unsigned flags = commit->object.flags;
> +
> +		/* Undo the SHOWN and FORCE_REPLAY bits */
> +		commit->object.flags = flags & ~(SHOWN | FORCE_REPLAY);
> +		commit->indegree = 0;
> +
> +		/* Remove it from the shown list, put it on the commit list */
> +		revs->shown = entry->next;
> +		entry->next = revs->commits;
> +		revs->commits = entry;
> +
> +		printf("Replay %s\n", sha1_to_hex(commit->object.sha1));
> +
> +		/* Was this the one that caused us to replay? */
> +		if (flags & FORCE_REPLAY)
> +			break;

Can one iteration of loop in log_tree_commit() smudge more
than one commits with FORCE_REPLAY?  Maybe make the
trigger_replay a counter and count down in this loop until we
find that many commits that have the FORCE_REPLAY flag?

  reply	other threads:[~2007-11-02 21:05 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-28  1:39 New features in gitk Paul Mackerras
2007-10-28  5:34 ` Linus Torvalds
2007-10-28  7:11   ` Paul Mackerras
2007-10-28  7:36     ` Steffen Prohaska
2007-10-28 16:50     ` Linus Torvalds
2007-11-01 10:00       ` Paul Mackerras
2007-11-01 15:16         ` Linus Torvalds
2007-11-02 10:19           ` Paul Mackerras
2007-11-02 12:44             ` Marco Costalba
2007-11-02 15:42               ` Linus Torvalds
2007-11-02 16:50                 ` Marco Costalba
2007-11-02 18:16                 ` Linus Torvalds
2007-11-02 20:31                   ` [PATCH 0/2] History replay support Linus Torvalds
2007-11-02 20:32                     ` [PATCH 1/2] Simplify topo-sort logic Linus Torvalds
2007-11-02 20:35                     ` [PATCH 2/2] Support "history replay" for git log commands Linus Torvalds
2007-11-02 21:05                       ` Junio C Hamano [this message]
2007-11-02 21:17                         ` Linus Torvalds
2007-11-03  1:40                     ` [PATCH 0/2] History replay support Linus Torvalds
2007-11-03  7:56                       ` Marco Costalba
2007-11-03 18:11                       ` [REPLACEMENT PATCH 2/2] Add "--early-output" log flag for interactive GUI use Linus Torvalds
2007-11-03 19:52                         ` Marco Costalba
2007-11-04  3:06                         ` Paul Mackerras
2007-11-04  5:38                           ` Linus Torvalds
2007-11-04  7:10                             ` Paul Mackerras
2007-11-04  7:52                               ` Marco Costalba
2007-11-04 18:11                             ` Linus Torvalds
2007-11-04 20:12                               ` [PATCH 3/2] Enhance --early-output format Linus Torvalds
2007-11-05 20:24                                 ` Junio C Hamano
2007-11-05 20:47                                   ` Linus Torvalds
2007-11-05 21:22                                     ` Linus Torvalds
2007-11-05 21:35                                       ` Linus Torvalds
2007-11-13  4:58                                 ` [PATCH 4/2] Fix parent rewriting in --early-output Linus Torvalds
2007-11-13  5:43                                   ` Junio C Hamano
2007-11-13  6:46                                     ` Linus Torvalds
2007-11-13  7:16                                       ` Linus Torvalds
2007-11-13  7:53                                         ` Sven Verdoolaege
2007-11-13  8:48                                         ` Junio C Hamano
2007-11-13  8:01                                     ` Shawn O. Pearce
2007-11-13  8:24                                       ` Junio C Hamano
2007-11-13  9:59                                   ` Paul Mackerras
2007-11-13 18:53                                     ` Junio C Hamano
2007-11-13 21:55                                       ` Paul Mackerras
2007-11-16  7:30                                     ` Marco Costalba
2007-11-04  0:32                       ` [PATCH 0/2] History replay support Paul Mackerras
2007-11-02 18:17                 ` New features in gitk Johannes Schindelin
2007-11-02 15:03             ` Linus Torvalds
2007-11-01 11:37       ` Paul Mackerras
2007-11-01 15:47         ` Linus Torvalds
2007-11-01 16:21           ` Linus Torvalds
2007-10-28 18:32 ` Pierre Habouzit
2007-10-28 18:38   ` Mike Hommey
2007-10-28 23:13   ` Paul Mackerras
2007-10-29  6:20     ` Pierre Habouzit
2007-10-29  8:31       ` Jonathan del Strother
2007-10-29  6:24     ` Pierre Habouzit
2007-10-29 13:30 ` Han-Wen Nienhuys
2007-10-29 14:04 ` Michele Ballabio

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=7v4pg41hq0.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=mcostalba@gmail.com \
    --cc=paulus@samba.org \
    --cc=torvalds@linux-foundation.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 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.