From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Alex Riesen <raa.lkml@gmail.com>
Cc: "Git Mailing List" <git@vger.kernel.org>,
"Johannes Sixt" <j.sixt@viscovery.net>,
"Junio C Hamano" <gitster@pobox.com>,
"Kristian Høgsberg" <krh@redhat.com>
Subject: Re: [PATCH] Do not generate full commit log message if it not going to be used
Date: Wed, 28 Nov 2007 21:43:12 +0000 (GMT) [thread overview]
Message-ID: <Pine.LNX.4.64.0711282140470.27959@racer.site> (raw)
In-Reply-To: <20071128211059.GA3173@steel.home>
Hi,
On Wed, 28 Nov 2007, Alex Riesen wrote:
> Johannes Schindelin, Wed, Nov 28, 2007 13:18:10 +0100:
> > On Tue, 27 Nov 2007, Alex Riesen wrote:
> >
> > > Could not stop myself. Hopefully didn't beat anyone to it :)
> > > Almost all code shamelessly stolen from builtin-diff-index.c.
> >
> > Then I have to wonder if it would not be a better idea to refactor the
> > code, so that other people do not have to steal the code again, but are
> > able to reuse it ;-)
>
> Not sure it will be worth the effort. It is really short.
Okay.
> > > Preprocessor trickery in DIFF_OPT_* macros is disgusting, it breaks Vim
> > > word completion and trying to use many flags in one expression looks
> > > just ugly.
> >
> > How does it break Vim word completion? And why should something like
> >
> > DIFF_OPT_SET(&rev.diffopt, QUIET | EXIT_WITH_STATUS);
> >
> > look ugly? I find it highly readable.
>
> Oh, this would look ok. It just wont compile: DIFF_OPT_SET prepends
> second argument with DIFF_OPT_:
>
> #define DIFF_OPT_TST(opts, flag) ((opts)->flags & DIFF_OPT_##flag)
> #define DIFF_OPT_SET(opts, flag) ((opts)->flags |= DIFF_OPT_##flag)
> #define DIFF_OPT_CLR(opts, flag) ((opts)->flags &= ~DIFF_OPT_##flag)
Ouch. Sorry for suggesting it when I clearly had no clue.
> > > + if (no_edit) {
> > > + static const char *argv[] = { NULL, "HEAD", NULL };
> > > + struct rev_info rev;
> > > + unsigned char sha1[40];
> > > + int is_initial;
> > > +
> > > + fclose(fp);
> > > +
> > > + if (!active_nr && read_cache() < 0)
> > > + die("Cannot read index");
> > > +
> > > + if (get_sha1("HEAD", sha1) != 0)
> > > + return !!active_nr;
> >
> > Don't want to be anal here, but are there possibly reasons (read "possible
> > errors") other than an empty repo where this triggers?
>
> Definitely. I just don't know. OTOH, I can only return "committable" or
> "not committable".
I guess it is good enough. Just wanted to point out that this can fail if
.git/HEAD is not readable.
> > Besides, would this not be more elegant as
> >
> > setup_revisions(0, NULL, &rev, "HEAD");
>
> Hmm... And I was so puzzled as to what that "def" argument could
> possibly mean... Still am, in fact. But it works.
It is the mechanism which makes "git log" default to "git log HEAD".
> > Other than that (including my remark about refactoring that piece of
> > code), I like it.
>
> Me too: I have *extensively* tested it today and a commit on the
> 2.6GHz/2Gb/SATA windows machine is almost as fast as on my linux
> laptop now (Centrino/1.2GHz downclocked to 800MHz/384Mb/IDE).
Yes, I suspected something like this would happen.
Ciao,
Dscho
prev parent reply other threads:[~2007-11-28 21:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-27 10:54 [PATCH] builtin-commit: add --cached to operate only on index Alex Riesen
2007-11-27 11:18 ` Johannes Schindelin
2007-11-27 12:57 ` Alex Riesen
2007-11-27 11:35 ` Johannes Sixt
2007-11-27 12:48 ` Alex Riesen
2007-11-27 17:16 ` Junio C Hamano
2007-11-27 18:12 ` Alex Riesen
2007-11-27 18:18 ` Alex Riesen
2007-11-27 21:44 ` [PATCH] Do not generate full commit log message if it not going to be used Alex Riesen
2007-11-27 21:47 ` Alex Riesen
2007-11-28 12:18 ` Johannes Schindelin
2007-11-28 21:10 ` Alex Riesen
2007-11-28 21:13 ` [PATCH] Do not generate full commit log message if it is " Alex Riesen
2007-11-28 21:43 ` Johannes Schindelin [this message]
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=Pine.LNX.4.64.0711282140470.27959@racer.site \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=j.sixt@viscovery.net \
--cc=krh@redhat.com \
--cc=raa.lkml@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).