Re: [PATCH v2 07/14] apply: make parse_git_header public
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jul 5, 2019, 18:48 UTC
- Message-ID
- <nycvar.QRO.7.76.6.1907052047260.44@tvgsbejvaqbjf.bet>
- In-Reply-To
- <20190705170630.27500-8-t.gummerer@gmail.com>
Hi Thomas,
On Fri, 5 Jul 2019, Thomas Gummerer wrote:
> Make parse_git_header a "public" function in apply.h, so we can re-use > it in range-diff in a subsequent commit.
This function probably wants a different name when it becomes public, as it was relatively obvious inside `apply.c` that it was talking about a Git _diff_ header. Maybe `parse_git_diff_header()`?
Show 6 quoted lines
> @@ -127,6 +161,20 @@ int init_apply_state(struct apply_state *state, > void clear_apply_state(struct apply_state *state); > int check_apply_state(struct apply_state *state, int force_apply); > > +/* > + * Parse a get header, starting at line. Fills the relevant metadata
s/get/git/
Ciao, Dscho
Show 19 quoted lines
> + * information in 'struct patch'. > + * > + * Returns -1 on failure, the length of the parsed header otherwise. > + */ > +int parse_git_header(struct strbuf *root, > + int *linenr, > + int p_value, > + const char *line, > + int len, > + unsigned int size, > + struct patch *patch); > + > /* > * Some aspects of the apply behavior are controlled by the following > * bits in the "options" parameter passed to apply_all_patches(). > -- > 2.22.0.510.g264f2c817a > >