mbox series

[v2,0/3] Refactor writing promisor file

Message ID 20210114155016.3005932-1-chriscool@tuxfamily.org (mailing list archive)
Headers show
Series Refactor writing promisor file | expand

Message

Christian Couder Jan. 14, 2021, 3:50 p.m. UTC
This is a small patch series to refactor the code that actually writes
a promisor file (<pack-name>.promisor) into a write_promisor_file()
function, and then to improve it a bit.

Compared to version 1 of this patch series, the only difference is
that patch 3/3 has been added to die() in case of error, instead of
ignoring it, when actually writing the content of the file or closing
it. Thanks to Peff and Taylor for their suggestions.

Discussion about V1:
  https://lore.kernel.org/git/20210112082159.2277214-1-chriscool@tuxfamily.org/

Christian Couder (3):
  fetch-pack: rename helper to create_promisor_file()
  fetch-pack: refactor writing promisor file
  pack-write: die on error in write_promisor_file()

 builtin/repack.c |  8 +++-----
 fetch-pack.c     | 16 +++++-----------
 pack-write.c     | 16 ++++++++++++++++
 pack.h           |  4 ++++
 4 files changed, 28 insertions(+), 16 deletions(-)

Comments

Taylor Blau Jan. 14, 2021, 5:23 p.m. UTC | #1
On Thu, Jan 14, 2021 at 04:50:13PM +0100, Christian Couder wrote:
> Compared to version 1 of this patch series, the only difference is
> that patch 3/3 has been added to die() in case of error, instead of
> ignoring it, when actually writing the content of the file or closing
> it. Thanks to Peff and Taylor for their suggestions.

Thanks, this version looks good to me.

Thanks,
Taylor
Jeff King Jan. 14, 2021, 8:11 p.m. UTC | #2
On Thu, Jan 14, 2021 at 04:50:13PM +0100, Christian Couder wrote:

> This is a small patch series to refactor the code that actually writes
> a promisor file (<pack-name>.promisor) into a write_promisor_file()
> function, and then to improve it a bit.
> 
> Compared to version 1 of this patch series, the only difference is
> that patch 3/3 has been added to die() in case of error, instead of
> ignoring it, when actually writing the content of the file or closing
> it. Thanks to Peff and Taylor for their suggestions.

These look great to me. Thanks for adding the extra error handling.

-Peff