Web lists-archives.com

Re: [GSoC][PATCH v3 08/13] sequencer: refactor append_todo_help() to write its message to a buffer

Alban Gruin <alban.gruin@xxxxxxxxx> writes:

> diff --git a/rebase-interactive.h b/rebase-interactive.h
> index 155219e74..c0ba83be3 100644
> --- a/rebase-interactive.h
> +++ b/rebase-interactive.h
> @@ -1,7 +1,12 @@
> -int append_todo_help(unsigned edit_todo, unsigned keep_empty);
> +#include <cache.h>
> +#include <strbuf.h>

Even though arguments can be made that using angle-bracket to refer
to our own headers like the above is more kosher, such a clean-up is
not part of the GSoC topic, so let's refrain from doing a little
crusade like this and imitate the way the other existing files
include things.

Actually, unless there is a definition of the structure that you
require in your header file to define your own structure, we are
better off not including another header from your own header.

Whoever includes "rebase-interactive.h", if it needs to know what
strbuf looks like in order to call append_todo_help(), should
include "strbuf.h" itself.  Those who only need to call
append_todo_help_to_file or edit_todo_list hence do not need to know
about strbuf, if such a caller existed, should not be forced to
include "strbuf.h".

> +
> +void append_todo_help(unsigned edit_todo, unsigned keep_empty,
> +		      struct strbuf *buf);
> +int append_todo_help_to_file(unsigned edit_todo, unsigned keep_empty);
>  int edit_todo_list(unsigned flags);
>  #endif