On Sat, Mar 02, 2013 at 10:19:32AM -0500, Jason A. Donenfeld wrote:
> On Sat, Mar 2, 2013 at 7:32 AM, John Keeping <j...@keeping.me.uk> wrote:
> > This release changes the archive interface so that we now need to pass
> > argv into write_archive().
> 
> It's a bit of a bummer having to do it this way -- I rather liked
> struct archiver_args. Such is life.
> 
> > -       args.time = commit->date;
> 
> Do we loose something significant by not being able to provide the
> date like this, or do the new args take care of this automatically
> when parsing the hex?

The Git write_archive() method does exactly this, so nothing is lost
here.

> Also, can we axe the commit lookup code, now that that pointer isn't used?
> 
>       struct commit *commit;
>       commit = lookup_commit_reference(sha1);
>       if(!commit) {
>               cgit_print_error(fmt("Not a commit reference: %s", hex));
>               return 1;
>       }
> 
> Or are we unable to handle errors later on, and so it's best to
> validate here? At the very least, we don't need the commit pointer
> hanging around any longer.

If we pass something invalid into Git it will die() on us, so I left
this in so that we can provide a sensible error message.

You're right that we can get rid of the "commit" variable.  Can you do
that as a fixup or would you like me to re-send?


John

_______________________________________________
cgit mailing list
cgit@hjemli.net
http://hjemli.net/mailman/listinfo/cgit

Reply via email to