Re: [Outreachy] [PATCH] blame: Convert pickaxe_blame defined constants to enums

2019-10-15 Thread Wambui Karuga
On Mon, Oct 14, 2019 at 02:46:29PM -0700, Jonathan Tan wrote: > > > Well, I agree that it could be better, but with the C language as we > > > have it now, I still slightly prefer an enum to a list of #define. Both > > > ways, we still have to manually enter values for each flag, but with > > > enu

Re: [Outreachy] [PATCH] blame: Convert pickaxe_blame defined constants to enums

2019-10-15 Thread SZEDER Gábor
On Mon, Oct 14, 2019 at 11:27:54AM -0700, Jonathan Tan wrote: > > Jonathan Tan writes: > > > > >> > Also, I have a slight preference for putting "= 02" on the BLAME_COPY > > >> > line but that is not necessary. > > >> > > >> That is absolutely necessary; it is not like "we do not care what > > >

Re: [Outreachy] [PATCH] blame: Convert pickaxe_blame defined constants to enums

2019-10-14 Thread Jonathan Tan
> > Well, I agree that it could be better, but with the C language as we > > have it now, I still slightly prefer an enum to a list of #define. Both > > ways, we still have to manually enter values for each flag, but with > > enum, we get better debugger display (at least in gdb) and in the > > fun

Re: [Outreachy] [PATCH] blame: Convert pickaxe_blame defined constants to enums

2019-10-14 Thread Wambui Karuga
On Mon, Oct 14, 2019 at 11:27:54AM -0700, Jonathan Tan wrote: > > Jonathan Tan writes: > > > > >> > Also, I have a slight preference for putting "= 02" on the BLAME_COPY > > >> > line but that is not necessary. > > >> > > >> That is absolutely necessary; it is not like "we do not care what > > >

Re: [Outreachy] [PATCH] blame: Convert pickaxe_blame defined constants to enums

2019-10-14 Thread Jonathan Tan
> Jonathan Tan writes: > > >> > Also, I have a slight preference for putting "= 02" on the BLAME_COPY > >> > line but that is not necessary. > >> > >> That is absolutely necessary; it is not like "we do not care what > >> exact value _COPY gets; it can be any value as long as it is _MOVE > >> pl

Re: [Outreachy] [PATCH] blame: Convert pickaxe_blame defined constants to enums

2019-10-11 Thread Junio C Hamano
Jonathan Tan writes: >> > Also, I have a slight preference for putting "= 02" on the BLAME_COPY >> > line but that is not necessary. >> >> That is absolutely necessary; it is not like "we do not care what >> exact value _COPY gets; it can be any value as long as it is _MOVE >> plus 1", as these

Re: [Outreachy] [PATCH] blame: Convert pickaxe_blame defined constants to enums

2019-10-11 Thread Wambui Karuga
On Fri, Oct 11, 2019 at 11:48:03AM -0700, Jonathan Tan wrote: > > > Any reason why the names are renamed to omit "PICKAXE_"? In particular, > > > these names are still global, so it is good to retain the extra context. > > > > > > (This doesn't mean that you are wrong to remove them - I just gave

Re: [Outreachy] [PATCH] blame: Convert pickaxe_blame defined constants to enums

2019-10-11 Thread Jonathan Tan
> > Any reason why the names are renamed to omit "PICKAXE_"? In particular, > > these names are still global, so it is good to retain the extra context. > > > > (This doesn't mean that you are wrong to remove them - I just gave my > > opinion, and a reason for my opinion. If you had a reason to re

Re: [Outreachy] [PATCH] blame: Convert pickaxe_blame defined constants to enums

2019-10-11 Thread Jonathan Tan
> Jonathan Tan writes: > > >> - if ((opt & PICKAXE_BLAME_COPY_HARDEST) > >> - || ((opt & PICKAXE_BLAME_COPY_HARDER) > >> + if ((opt & BLAME_COPY_HARDEST) > >> + || ((opt & BLAME_COPY_HARDER) > > > > Any reason why the names are renamed to omit "PICKAXE_"? In particular, > > these name

Re: [Outreachy] [PATCH] blame: Convert pickaxe_blame defined constants to enums

2019-10-11 Thread Wambui Karuga
On Thu, Oct 10, 2019 at 11:44:39AM -0700, Jonathan Tan wrote: > > Convert pickaxe_blame preprocessor constants in blame.h to an enum. > > Also replace previous instances of the constants with the new enum values. > > First of all, thanks for your initiative in finding a microproject and > making a

Re: [Outreachy] [PATCH] blame: Convert pickaxe_blame defined constants to enums

2019-10-10 Thread Junio C Hamano
Jonathan Tan writes: >> -if ((opt & PICKAXE_BLAME_COPY_HARDEST) >> -|| ((opt & PICKAXE_BLAME_COPY_HARDER) >> +if ((opt & BLAME_COPY_HARDEST) >> +|| ((opt & BLAME_COPY_HARDER) > > Any reason why the names are renamed to omit "PICKAXE_"? In particular, > these names are stil

Re: [Outreachy] [PATCH] blame: Convert pickaxe_blame defined constants to enums

2019-10-10 Thread Jonathan Tan
> Convert pickaxe_blame preprocessor constants in blame.h to an enum. > Also replace previous instances of the constants with the new enum values. First of all, thanks for your initiative in finding a microproject and making a patch for it! About your commit message title, I know that 50 characte

[Outreachy] [PATCH] blame: Convert pickaxe_blame defined constants to enums

2019-10-10 Thread Wambui Karuga
Convert pickaxe_blame preprocessor constants in blame.h to an enum. Also replace previous instances of the constants with the new enum values. Signed-off-by: Wambui Karuga --- blame.c | 8 blame.h | 12 +++- builtin/blame.c | 17 - 3 files change