git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "H.Merijn Brand" <h.m.brand@xs4all.nl>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: read_branches_file ()
Date: Fri, 8 Feb 2008 17:49:24 +0100	[thread overview]
Message-ID: <20080208174924.24203ff3@pc09.procura.nl> (raw)
In-Reply-To: <alpine.LSU.1.00.0802081618210.11591@racer.site>

On Fri, 8 Feb 2008 16:22:45 +0000 (GMT), Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:

> Hi,
> 
> On Fri, 8 Feb 2008, H.Merijn Brand wrote:
> 
> > --8<--- remote.c.diff
> > --- remote.c.org        2008-01-27 09:04:18 +0100
> > +++ remote.c    2008-02-08 17:01:09 +0100
> > @@ -1,6 +1,7 @@
> >  #include "cache.h"
> >  #include "remote.h"
> >  #include "refs.h"
> > +#include <sys/stat.h>
> 
> This should not be necessary; we include all system headers in cache.h.

dropped

> > @@ -173,11 +174,15 @@ static void read_branches_file(struct re
> >         char *frag;
> >         char *branch;
> >         int n = slash ? slash - remote->name : 1000;
> > -       FILE *f = fopen(git_path("branches/%.*s", n, remote->name), "r");
> > +       char *gp = git_path ("branches/%.*s", n, remote->name);
> 
> Please use a more descriptive variable name, such as "branches_file" or 
> "branches_path".

took another approach, as that also addresses the other fopen () call

> Also, we only leave a space after operators like "for", "while", but not 
> after function names.

This patch was not sent to be applied as-is, only as a proof-of-concept
Not that I agree to the layout/indentation, the new patch is sent trying
to follow what you use.

> > +       if (stat (gp, &st_buf) || S_ISDIR (st_buf.st_mode))
> 
> Again, please remove the spaces after "stat" and "S_ISDIR".

you said please :)

> Other than that, the patch looks obviously correct: please resubmit with a 
> nice commit message and a sign-off.

Done

-- 
H.Merijn Brand         Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using & porting perl 5.6.2, 5.8.x, 5.10.x  on HP-UX 10.20, 11.00, 11.11,
& 11.23, SuSE 10.1 & 10.2, AIX 5.2, and Cygwin.       http://qa.perl.org
http://mirrors.develooper.com/hpux/            http://www.test-smoke.org
                        http://www.goldmark.org/jeff/stupid-disclaimers/

  reply	other threads:[~2008-02-08 16:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-08 15:50 read_branches_file () H.Merijn Brand
2008-02-08 16:03 ` H.Merijn Brand
2008-02-08 16:22   ` Johannes Schindelin
2008-02-08 16:49     ` H.Merijn Brand [this message]
2008-02-11 10:00   ` Andreas Ericsson
2008-02-11 10:17     ` H.Merijn Brand
2008-02-08 17:18 ` Daniel Barkalow

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=20080208174924.24203ff3@pc09.procura.nl \
    --to=h.m.brand@xs4all.nl \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    /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).