Re: [PATCH] refs.c: add a function to append a reflog entry to a fd

2014-11-20 Thread Junio C Hamano
Jonathan Nieder jrnie...@gmail.com writes: Break out the code to create the string and writing it to the file descriptor from log_ref_write and add it into a dedicated function log_ref_write_fd. (grammar) I'm having trouble parsing the above. Yeah, I can see what it wants to say, but

[PATCH] refs.c: add a function to append a reflog entry to a fd

2014-11-19 Thread Stefan Beller
From: Ronnie Sahlberg sahlb...@google.com Break out the code to create the string and writing it to the file descriptor from log_ref_write and add it into a dedicated function log_ref_write_fd. For now this is only used from log_ref_write, but later on we will call this function from reflog

Re: [PATCH] refs.c: add a function to append a reflog entry to a fd

2014-11-19 Thread Junio C Hamano
Stefan Beller sbel...@google.com writes: Compared to the last send of this patch[1], there was one change in the print function. Replaced sprintf by snprintf for security reasons. Careful. I despise people who blindly think strlcpy() and snprintf() are good solutions for for security. They

Re: [PATCH] refs.c: add a function to append a reflog entry to a fd

2014-11-19 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Stefan Beller sbel...@google.com writes: Compared to the last send of this patch[1], there was one change in the print function. Replaced sprintf by snprintf for security reasons. Careful. I despise people who blindly think strlcpy() and

Re: [PATCH] refs.c: add a function to append a reflog entry to a fd

2014-11-19 Thread Jonathan Nieder
Stefan Beller wrote: Compared to the last send of this patch[1], there was one change in the print function. Replaced sprintf by snprintf for security reasons. I prefer the version that didn't change the code while we are extracting it into a new function. A separate patch on top can switch

[PATCH] refs.c: add a function to append a reflog entry to a fd

2014-11-19 Thread Stefan Beller
Break out the code to create the string and writing it to the file descriptor from log_ref_write and add it into a dedicated function log_ref_write_fd. For now this is only used from log_ref_write, but later on we will call this function from reflog transactions too, which means that we will end

Re: [PATCH] refs.c: add a function to append a reflog entry to a fd

2014-11-19 Thread Jonathan Nieder
Stefan Beller wrote: [Subject: [PATCH] refs.c: add a function to append a reflog entry to a fd] Does this supersede the other patch with the same subject? Please keep adding vnum in the subject --- when it's there, it makes reading much easier. Missing 'From:' line naming the original patch