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

2 messages from 2005-04-18 to 2005-04-18. Participants: Petr Baudis, David Woodhouse.
Thread: https://gitlist.dev/t/98

## Petr Baudis, 2005-04-18 10:27

Subject: Re: [PATCH] Pretty-print date in 'git log'
Message-ID: <20050418102744.GK1461@pasky.ji.cz>
URL: https://gitlist.dev/e/20050418102744.GK1461%40pasky.ji.cz
In-Reply-To: <1113808105.5286.1.camel@localhost.localdomain>

```
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...
> 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, 2005-04-18 12:24

Subject: Re: [PATCH] Pretty-print date in 'git log'
Message-ID: <1113827080.5286.10.camel@localhost.localdomain>
URL: https://gitlist.dev/e/1113827080.5286.10.camel%40localhost.localdomain
In-Reply-To: <20050418102744.GK1461@pasky.ji.cz>

```
On Mon, 2005-04-18 at 12:27 +0200, Petr Baudis wrote:
> 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


```
