Re: [PATCH] Port git-tag.sh to C.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: krh
Date: Saturday, June 9, 2007 - 4:27 pm

Junio C Hamano wrote:

That's odd both the email I cc'ed to my redhat.com address and the one I got 
on gmail.com through the list have

   Content-Type: text/plain; charset=utf-8

and saving the raw message and asking /usr/bin/file, it tells me its

   /home/krh/Desktop/hep: UTF-8 Unicode mail text


Yeah, true.  I did write it as a generally usable "launch editor" functions, 
but I didn't want to move it until there was a second user.  Is there anything 
else that git-commit that will use this, btw?


Oh hehe, yeah, I didn't think much about the permission bits... 0666 sounds fine.


Even less thinking here :)


and that last function should be useful for git-commit too, no?  The reason I 
didn't split it up was that I don't see any use for the two parts on their 
own, and the functions is a total of 70 lines.  And wouldn't returning 0 bytes 
for either an empty buffer or editor quit be sufficient?  Do we need to handle 
the two cases differently?


Oh... read_pipe() reallocs... OK.  I took the limit from mktag.c and didn't 
realize that the buffer could get realloced.  I did wonder about the xmalloc() 
for a fixed buffer though...


I do

         if (check_ref_format(ref))
                 die("'%s' is not a valid tag name.", tag);

on the ref, which is what git-tag.sh ends up doing, and it catches the two 
examples you mention:

[krh@dinky git]$ ./git tag "hello
 > world"
fatal: 'hello
world' is not a valid tag name.
[krh@dinky git]$ ./git tag ""
fatal: '' is not a valid tag name.

so I think it's fine.

But I think I'll leave it to Carlos to finish his builtin-tag work, and he can 
cherry pick the bits from my patch that work for him.  This was more of a 
friday afternoon hacking sprint, for my part.

cheers,
Kristian

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Port git-tag.sh to C., krh, (Fri Jun 8, 3:45 pm)
Re: [PATCH] Port git-tag.sh to C., Carlos Rica, (Fri Jun 8, 6:58 pm)
Re: [PATCH] Port git-tag.sh to C., Junio C Hamano, (Sat Jun 9, 11:26 am)
Re: [PATCH] Port git-tag.sh to C., krh, (Sat Jun 9, 4:27 pm)
Re: [PATCH] Port git-tag.sh to C., Robin Rosenberg, (Sun Jun 10, 5:37 am)
Re: [PATCH] Port git-tag.sh to C., Junio C Hamano, (Sun Jun 10, 2:36 pm)
Re: [PATCH] Port git-tag.sh to C., Jeff King, (Sun Jun 10, 3:13 pm)
Re: [PATCH] Port git-tag.sh to C., Junio C Hamano, (Sun Jun 10, 3:19 pm)
Re: [PATCH] Port git-tag.sh to C., Jeff King, (Sun Jun 10, 3:22 pm)
Re: [PATCH] Port git-tag.sh to C., Daniel Barkalow, (Mon Jun 11, 8:28 pm)
git-fetch, was Re: [PATCH] Port git-tag.sh to C., Johannes Schindelin, (Tue Jun 12, 5:41 am)
Re: git-fetch, was Re: [PATCH] Port git-tag.sh to C., Julian Phillips, (Tue Jun 12, 6:29 am)
Re: git-fetch, was Re: [PATCH] Port git-tag.sh to C., Daniel Barkalow, (Tue Jun 12, 9:51 am)
Re: git-fetch, was Re: [PATCH] Port git-tag.sh to C., Daniel Barkalow, (Tue Jun 12, 4:55 pm)
Re: git-fetch, was Re: [PATCH] Port git-tag.sh to C., Johannes Schindelin, (Tue Jun 12, 5:27 pm)