Re: [PATCH 2/3] reset: use DIFF_OPT_SET macro to set a diff flag

2017-10-30 Thread Brandon Williams
On 10/29, Junio C Hamano wrote:
> Brandon Williams  writes:
> 
> > Instead of explicitly setting the 'DIFF_OPT_OVERRIDE_SUBMODULE_CONFIG'
> > flag, use the 'DIFF_OPT_SET' macro.
> >
> > Signed-off-by: Brandon Williams 
> > ---
> 
> Looks good.  It's not like one of 1/3 and 2/3 could be a good idea
> while the other is not, so it would make a lot more sense to combine
> them into a single preliminary clean-up patch, though.  
> 

I'll squash them together in v2.

> In any case, these two are very good clean-up patches, whose value
> does not diminish even we do not go ahead with 3/3 yet.  
> 
> Nicely spotted; thanks.
> 
> 
> >  builtin/reset.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/builtin/reset.c b/builtin/reset.c
> > index 9cd89b230..ea2fad5a0 100644
> > --- a/builtin/reset.c
> > +++ b/builtin/reset.c
> > @@ -166,7 +166,7 @@ static int read_from_tree(const struct pathspec 
> > *pathspec,
> > opt.output_format = DIFF_FORMAT_CALLBACK;
> > opt.format_callback = update_index_from_diff;
> > opt.format_callback_data = _to_add;
> > -   opt.flags |= DIFF_OPT_OVERRIDE_SUBMODULE_CONFIG;
> > +   DIFF_OPT_SET(, OVERRIDE_SUBMODULE_CONFIG);
> >  
> > if (do_diff_cache(tree_oid, ))
> > return 1;

-- 
Brandon Williams


Re: [PATCH 2/3] reset: use DIFF_OPT_SET macro to set a diff flag

2017-10-28 Thread Junio C Hamano
Brandon Williams  writes:

> Instead of explicitly setting the 'DIFF_OPT_OVERRIDE_SUBMODULE_CONFIG'
> flag, use the 'DIFF_OPT_SET' macro.
>
> Signed-off-by: Brandon Williams 
> ---

Looks good.  It's not like one of 1/3 and 2/3 could be a good idea
while the other is not, so it would make a lot more sense to combine
them into a single preliminary clean-up patch, though.  

In any case, these two are very good clean-up patches, whose value
does not diminish even we do not go ahead with 3/3 yet.  

Nicely spotted; thanks.


>  builtin/reset.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/builtin/reset.c b/builtin/reset.c
> index 9cd89b230..ea2fad5a0 100644
> --- a/builtin/reset.c
> +++ b/builtin/reset.c
> @@ -166,7 +166,7 @@ static int read_from_tree(const struct pathspec *pathspec,
>   opt.output_format = DIFF_FORMAT_CALLBACK;
>   opt.format_callback = update_index_from_diff;
>   opt.format_callback_data = _to_add;
> - opt.flags |= DIFF_OPT_OVERRIDE_SUBMODULE_CONFIG;
> + DIFF_OPT_SET(, OVERRIDE_SUBMODULE_CONFIG);
>  
>   if (do_diff_cache(tree_oid, ))
>   return 1;


[PATCH 2/3] reset: use DIFF_OPT_SET macro to set a diff flag

2017-10-27 Thread Brandon Williams
Instead of explicitly setting the 'DIFF_OPT_OVERRIDE_SUBMODULE_CONFIG'
flag, use the 'DIFF_OPT_SET' macro.

Signed-off-by: Brandon Williams 
---
 builtin/reset.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/reset.c b/builtin/reset.c
index 9cd89b230..ea2fad5a0 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -166,7 +166,7 @@ static int read_from_tree(const struct pathspec *pathspec,
opt.output_format = DIFF_FORMAT_CALLBACK;
opt.format_callback = update_index_from_diff;
opt.format_callback_data = _to_add;
-   opt.flags |= DIFF_OPT_OVERRIDE_SUBMODULE_CONFIG;
+   DIFF_OPT_SET(, OVERRIDE_SUBMODULE_CONFIG);
 
if (do_diff_cache(tree_oid, ))
return 1;
-- 
2.15.0.rc2.357.g7e34df9404-goog