Re: [PATCH] defaults for where to merge from (take 3, inline)
From: Paolo Bonzini <hidden>
Date: 2016-06-15 22:42:57
please don't take my comments as insults or even strict rules. It is purely for your consideration. (I say this because I haven't seen you so often on this list, so you might not know that discussions about patches are sometimes, erm, lively...)
I absolutely haven't taken any of these comments in the thread as insults (the only thing I found a little dubious, was some usage of uppercase), and I got a lot of constructive criticism that outweighed the "lively" tone. And as a mistake on my part, I probably should have lurked a bit longer than I did.
quoted
+static void register_branch_pull (const char *name, const char *remote_name)It is not yet remote_name, right? it is branch_name. You extract the remote_name by finding the first slash.
Yeah, it's a remote_branch_name in fact.
I'd use "char key[1024], value[1024]" instead, erroring out if one of the buffers are too small. It's not like you have to be memory efficient, and it is easier to read.
Ok.
quoted
+ remote_value[slash - remote_name] = 0;You should check if slash == NULL and error out before using it.
remote_name is of the form "REMOTE/BRANCH", because it comes from dwim_ref's output after stripping "refs/remotes/" from the beginning.
Yes, that is how I imagined it. The rest of your patch looks perfect to me.
I will submit again with the requested changes. I guess the body of this message is too long to become a "cover letter". Paolo