threads / patch / 98

patchRe: [PATCH] Pretty-print date in 'git log'

Subject: Re: [PATCH] Pretty-print date in 'git log'

## tl;dr

2 messages between Apr 18, 2005 and Apr 18, 2005. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Petr Baudis· Apr 18, 2005, 10:27 UTC · lore

Dear diary, on Mon, Apr 18, 2005 at 09:08:24AM CEST, I got a letter where David Woodhouse <dwmw2@infradead.org> told me that...

Show 6 quoted lines
> On Mon, 2005-04-18 at 07:43 +0100, Sanjoy Mahajan wrote:
> > Is this short script good enough:
> 
> It's not far off; thanks. We might as well just do it like that inside
> gitlog.sh. Could do with falling back to just printing the input if it
> can't parse it -- the git repo has old-style dates in it still.
Yes. As far as I'm concerned, I'd put such stuff to git log, and extend
it usage so that it is possible to print individual log entries with it
- just make it accept a _range_ of commits, and then do
	git log $commit $commit
And maybe options for changelog-suitable output (RMK-like) etc.
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
David Woodhouse· Apr 18, 2005, 12:24 UTC · re: Petr Baudis · lore
On Mon, 2005-04-18 at 12:27 +0200, Petr Baudis wrote:
Show 5 quoted lines
> Yes. As far as I'm concerned, I'd put such stuff to git log, and extend
> it usage so that it is possible to print individual log entries with it
> - just make it accept a _range_ of commits, and then do
> 
>         git log $commit $commit

That's fairly trivial. In the current (and misguided) version with chronological output, rev-tree will do it all for you, in fact:

	rev-tree $1 ^$2
In the older and more useful version, it was only slightly more complex:
 base=$(gitXnormid.sh -c $1) || exit 1
 
+if [ -n "$2" ]; then
+    endpoint=$(gitXnormid.sh -c $2) || exit 1
+    if rev-tree $base $endpoint | grep -q $base:3; then
+        base=
+    else
+        rev-tree --edges $base $endpoint | sed 's/[a-z0-9]*:1//g' > $TMPCL
+    fi
+fi
 changelog $base
 rm $TMPCL $TMPCM
-- 
dwmw2

← back to recent threads