git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Denton Liu <liu.denton@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git Mailing List <git@vger.kernel.org>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Thomas Gummerer <t.gummerer@gmail.com>
Subject: Re: [PATCH v2 7/8] range-diff: passthrough --[no-]notes to `git log`
Date: Wed, 20 Nov 2019 11:12:58 -0800	[thread overview]
Message-ID: <20191120191258.GA73969@generichostname> (raw)
In-Reply-To: <xmqqwobvb2cj.fsf@gitster-ct.c.googlers.com>

Hi Junio,

On Wed, Nov 20, 2019 at 01:26:04PM +0900, Junio C Hamano wrote:
> Denton Liu <liu.denton@gmail.com> writes:
> 
> > When a commit being range-diff'd has a note attached to it, the note
> > will be compared as well. However, if a user has multiple notes refs or
> > if they want to suppress notes from being printed, there is currently no
> > way to do this.
> >
> > Passthrough `---no--notes` to the `git log` call so that this option is
> 
> "`--[no-]notes`" or perhaps "`--[no-]notes` and `--notes=<ref>`"?

Whoops, I probably typed `ys-` in vim instead of `ys[` so I surrounded
the `no-` with the wrong characters.

> 
> I think the verb phrase is two words, "pass through", by the way.

Thanks, I didn't know this.

> 
> > +--[no-]notes[=<treeish>]::
> > +	This flag is passed to the `git log` program
> > +	(see linkgit:git-log[1]) that generates the patches.
> 
> I can see this was taken from "git log --help", and it probably
> needs fixing for consistency as well, but I think --notes=<ref>
> would be easier to click users' minds with notes.displayRef
> configuration variable.

I'll put in a cleanup patch for this as well.

> 
> > @@ -61,8 +62,11 @@ static int read_patches(const char *range, struct string_list *list)
> >  			"--output-indicator-new=>",
> >  			"--output-indicator-old=<",
> >  			"--output-indicator-context=#",
> > -			"--no-abbrev-commit", range,
> > +			"--no-abbrev-commit",
> >  			NULL);
> > +	if (other_arg)
> > +		argv_array_pushv(&cp.args, other_arg->argv);
> > +	argv_array_push(&cp.args, range);
> 
> Makes sense.
> 
> > diff --git a/range-diff.h b/range-diff.h
> > index 08a50b6e98..7d918ab9ed 100644
> > --- a/range-diff.h
> > +++ b/range-diff.h
> > @@ -2,6 +2,7 @@
> >  #define RANGE_DIFF_H
> >  
> >  #include "diff.h"
> > +#include "argv-array.h"
> >  
> >  #define RANGE_DIFF_CREATION_FACTOR_DEFAULT 60
> >  
> > @@ -12,6 +13,7 @@
> >   */
> >  int show_range_diff(const char *range1, const char *range2,
> >  		    int creation_factor, int dual_color,
> > -		    struct diff_options *diffopt);
> > +		    struct diff_options *diffopt,
> > +		    struct argv_array *other_arg);
> >  
> >  #endif
> 
> I thought a mere use of "pointer to a struct" did not have to bring
> the definition of the struct into the picture?  In other words,
> wouldn't it be fine to leave the other_arg a pointer to an opaque
> structure by not including "argv-array.h" in this file?

Without including "argv-array.h", we get the following hdr-check error:

	$ make range-diff.hco
	    HDR range-diff.h
	In file included from range-diff.hcc:2:
	./range-diff.h:16:14: error: declaration of 'struct argv_array' will not be visible outside of this function [-Werror,-Wvisibility]
			    struct argv_array *other_arg);
				   ^
	1 error generated.
	make: *** [range-diff.hco] Error 1

I am currently using this compiler for reference:

	$ clang --version
	Apple LLVM version 10.0.1 (clang-1001.0.46.4)
	Target: x86_64-apple-darwin18.7.0
	Thread model: posix
	InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Thanks,

Denton

> 
> Thanks.

  reply	other threads:[~2019-11-20 19:13 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-19  1:06 [PATCH 0/3] range-diff: don't compare notes Denton Liu
2019-11-19  1:06 ` [PATCH 1/3] t3206: remove spaces after redirect operators Denton Liu
2019-11-19  1:06 ` [PATCH 2/3] t3206: demonstrate failure with notes Denton Liu
2019-11-19  3:03   ` Junio C Hamano
2019-11-19  1:06 ` [PATCH 3/3] range-diff: use --no-notes to generate patches Denton Liu
2019-11-19  2:56 ` [PATCH 0/3] range-diff: don't compare notes Junio C Hamano
2019-11-19 23:55 ` [PATCH v2 0/8] range-diff: learn `--notes` Denton Liu
2019-11-19 23:55   ` [PATCH v2 1/8] argv-array: add space after `while` Denton Liu
2019-11-19 23:55   ` [PATCH v2 2/8] rev-list-options.txt: remove reference to --show-notes Denton Liu
2019-11-19 23:55   ` [PATCH v2 3/8] t3206: remove spaces after redirect operators Denton Liu
2019-11-20  0:20     ` Eric Sunshine
2019-11-19 23:55   ` [PATCH v2 4/8] t3206: s/expected/expect/ Denton Liu
2019-11-19 23:55   ` [PATCH v2 5/8] t3206: demonstrate current notes behavior Denton Liu
2019-11-20  4:17     ` Junio C Hamano
2019-11-19 23:55   ` [PATCH v2 6/8] range-diff: output `## Notes ##` header Denton Liu
2019-11-19 23:55   ` [PATCH v2 7/8] range-diff: passthrough --[no-]notes to `git log` Denton Liu
2019-11-20  4:26     ` Junio C Hamano
2019-11-20 19:12       ` Denton Liu [this message]
2019-11-21 12:43         ` Eric Sunshine
2019-11-21 18:35           ` Denton Liu
2019-11-19 23:55   ` [PATCH v2 8/8] format-patch: pass notes configuration to range-diff Denton Liu
2019-11-20 21:18   ` [PATCH v3 00/10] range-diff: learn `--notes` Denton Liu
2019-11-20 21:18     ` [PATCH v3 01/10] argv-array: add space after `while` Denton Liu
2019-11-20 21:18     ` [PATCH v3 02/10] rev-list-options.txt: remove reference to --show-notes Denton Liu
2019-11-20 21:18     ` [PATCH v3 03/10] pretty-options.txt: --notes accepts a ref instead of treeish Denton Liu
2019-11-20 21:18     ` [PATCH v3 04/10] t3206: remove spaces after redirect operators Denton Liu
2019-11-20 21:18     ` [PATCH v3 05/10] t3206: disable parameter substitution in heredoc Denton Liu
2019-11-20 21:18     ` [PATCH v3 06/10] t3206: s/expected/expect/ Denton Liu
2019-11-20 21:18     ` [PATCH v3 07/10] t3206: range-diff compares logs with commit notes Denton Liu
2019-11-20 21:18     ` [PATCH v3 08/10] range-diff: output `## Notes ##` header Denton Liu
2019-11-20 21:18     ` [PATCH v3 09/10] range-diff: pass through --notes to `git log` Denton Liu
2019-11-20 21:18     ` [PATCH v3 10/10] format-patch: pass notes configuration to range-diff Denton Liu

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

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

  git send-email \
    --in-reply-to=20191120191258.GA73969@generichostname \
    --to=liu.denton@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=t.gummerer@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.
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 NNTP newsgroup(s).