Thread (4 messages) flat view 4 messages, 3 authors, 2016-06-15

Re: git and time

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:42

Nicolas Pitre [off-list ref] writes:
On Wed, 27 Sep 2006, Junio C Hamano wrote:
quoted
Nicolas Pitre [off-list ref] writes:
quoted
SYNOPSIS

	git-local-arrival <committish>

DESCRIPTION

	The command displays the time when given commit appeared in the 
	local repository.
This should be certainly doable, but local-arrival may not be
interesting if the repository has more than one branches.  Maybe

	git-local-arrival <committish> [<branch>]

which defaults to the current branch?
Indeed.  I didn't mention it initially because it is really easy to do 
once you have it working for the current branch.  The technical 
challenge is about making it efficient to find out which reflog entry 
with a path to given commit is the oldest.
The more I think about this, if we were to add yet another
command, I think it should be a command that lets us inspect
ref-log.  We do not have an UI other than @{time} syntax to
interact with it right now.

What are the things we would want?  Here is a strawman.

 - List when and how a branch was changed.

   git ref-log --list --type=merge next (when did I merge into my 'next'?)
   git ref-log --list --type=merge (ditto but any branches)
   git ref-log --list next (any changes not just 'merge')

   I expect the output would give timestamp and reason comment;
   in addition the branch name when no branch is specified.
   Type does not have to be a concrete thing -- it could just be
   a substring match in the reason comment string.

   Also we would limit output with -n <limit>.  The output
   should be sorted by the timestamp of ref-log entry -- we are
   talking about a particular repository's ref-log, so its
   timestamp has more sane meaning than in distributed case.
   
 - Find which branches currently contains a commit, and find the
   earliest time that the commit became part of each of them.

   git ref-log $commit next master (when did it enter 'next' and
                                    when did it graduate to 'master'?)
   git ref-log $commit (ditto but any branches)

   I expect the output to be the timestamp and reason comment;
   in addition the branch name when no branch is specified.

Also for a shared repository, the person who made the change
would be a reasonable thing to report.

So for consistency, in all cases we could make the output
format like this:

    branch SP time-and-zone SP name SP email SP reason-comment LF

where time-and-zone is human-readable timestamp as we see in
git-log output.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help