Re: [PATCH v4] install_branch_config: simplify verbose messages logic

2014-03-13 Thread Junio C Hamano
Eric Sunshine sunsh...@sunshineco.com writes: Shouldn't this logic [to decide what the printf arguments should be] also be encoded in the table? ... The same argument also applies to computation of the 'name' variable above. It too can be pushed into the the table. Because the printf

Re: [PATCH v4] install_branch_config: simplify verbose messages logic

2014-03-13 Thread Eric Sunshine
On Thu, Mar 13, 2014 at 2:34 PM, Junio C Hamano gits...@pobox.com wrote: Eric Sunshine sunsh...@sunshineco.com writes: Shouldn't this logic [to decide what the printf arguments should be] also be encoded in the table? ... The same argument also applies to computation of the 'name' variable

Re: [PATCH v4] install_branch_config: simplify verbose messages logic

2014-03-13 Thread Eric Sunshine
On Thu, Mar 13, 2014 at 4:35 PM, Eric Sunshine sunsh...@sunshineco.com wrote: A more table-driven approach might look something like this: struct M { const char *s; const char **a1; const char **a2; } message[][2][2] = {{{ { Branch %s set ... %s ... %s, shortname, origin },

[PATCH v4] install_branch_config: simplify verbose messages logic

2014-03-11 Thread Paweł Wawruch
Replace the chain of if statements with table of strings. Signed-off-by: Paweł Wawruch pa...@aleg.pl --- The changes proposed by Junio C Hamano: Improvement of indentations. Removed an unused variable. [1]: http://thread.gmane.org/gmane.comp.version-control.git/243502 [2]:

Re: [PATCH v4] install_branch_config: simplify verbose messages logic

2014-03-11 Thread Eric Sunshine
On Tue, Mar 11, 2014 at 8:33 PM, Paweł Wawruch pa...@aleg.pl wrote: Replace the chain of if statements with table of strings. Signed-off-by: Paweł Wawruch pa...@aleg.pl --- The changes proposed by Junio C Hamano: Improvement of indentations. Removed an unused variable. Better, thanks. More