git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Olga Telezhnaya <olyatelezhnaya@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH Outreachy v2 1/2] format: create pretty.h file
Date: Tue, 12 Dec 2017 14:12:50 -0800	[thread overview]
Message-ID: <xmqqh8svzjbx.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: 0102016049efb7b4-b8dc7cff-5ddf-4692-ba1c-3551720ec28d-000000@eu-west-1.amazonses.com

Olga Telezhnaya <olyatelezhnaya@gmail.com> writes:

>  builtin/notes.c       |  2 +-
>  builtin/reset.c       |  2 +-
>  builtin/show-branch.c |  2 +-
>  commit.h              | 81 +----------------------------------------------
>  pretty.h              | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  revision.h            |  2 +-
>  6 files changed, 92 insertions(+), 84 deletions(-)
>  create mode 100644 pretty.h
>
> diff --git a/builtin/notes.c b/builtin/notes.c
> index 1a2c7d92ad7e7..7c8176164561b 100644
> --- a/builtin/notes.c
> +++ b/builtin/notes.c
> @@ -12,7 +12,7 @@
>  #include "builtin.h"
>  #include "notes.h"
>  #include "blob.h"
> -#include "commit.h"
> +#include "pretty.h"
>  #include "refs.h"
>  #include "exec_cmd.h"
>  #include "run-command.h"
> ...
> diff --git a/commit.h b/commit.h
> index 99a3fea68d3f6..8c68ca1a5a187 100644
> --- a/commit.h
> +++ b/commit.h
> @@ -7,6 +7,7 @@
>  #include "decorate.h"
>  #include "gpg-interface.h"
>  #include "string-list.h"
> +#include "pretty.h"

This is much nicer than what I imagined, which was to just add this
line here, move decls from commit.h to pretty.h, and do nothing
else, which would be the absolute safest thing from the point of
view of other topics in flight.  Separation of "pretty.h" would stay
to be an implementation detail of the "commit.h" file, where
everybody expects to find these decls.

Instead, this patch inspects each and every .c user of "commit.h"
and replaces its '#include' with the new one if it only uses things
declared in "pretty.h", which makes it very clear who have been
depending on what in the patch.  Those that include "commit.h"
because they need both the "what is a commit object" aspect and "how
to pretty print" aspect can keep using their original '#include' to
ease the transition.

Let's see how well this plays with other topics in flight---I had to
apply an evil merge to queue the previous one, if I recall right, as
a user of "commit.h" that did not use pretty-print (hence did not
get "pretty.h" with the previous round of this patch) gained use of
pretty-print function, or something like that.

Will queue.

Thanks.

 

      parent reply	other threads:[~2017-12-12 22:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-08 13:21 [PATCH Outreachy 1/2] format: create pretty.h file Olga Telezhnaya
2017-12-08 13:21 ` [PATCH Outreachy 2/2] format: create docs for pretty.h Olga Telezhnaya
2017-12-08 19:26   ` Eric Sunshine
2017-12-08 17:40 ` [PATCH Outreachy 1/2] format: create pretty.h file Junio C Hamano
2017-12-10 14:53   ` Jeff King
2017-12-10 22:36     ` Junio C Hamano
2017-12-11  9:58       ` Оля Тележная
2017-12-11 20:43         ` Junio C Hamano
2017-12-08 18:11 ` Eric Sunshine
2017-12-08 20:37 ` Junio C Hamano
2017-12-09  7:48   ` Оля Тележная
2017-12-12  8:55 ` [PATCH Outreachy v2 " Olga Telezhnaya
2017-12-12  8:55   ` [PATCH Outreachy v2 2/2] format: create docs for pretty.h Olga Telezhnaya
2017-12-12 22:12   ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqh8svzjbx.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=olyatelezhnaya@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).