git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 01/15] builtin/add.c: rearrange xcalloc arguments

From
Brian Gesiak <modocache@gmail.com>
Date
May 27, 2014, 02:22 UTC
Message-ID
<CAN7MxmUPH5-qgZQ-Wm0GeenNmqHvtwtx5WkXynNX9zRP3Yr1tQ@mail.gmail.com>
In-Reply-To
<20140526231156.GA8570@hudson.localdomain>
My apologies! I based my work off of maint, branching off of eea591.

My reasoning was that Documentation/SubmittingPatches states that "a bugfix should be based on 'maint'". [1] Now that I think about it, this is probably not the kind of "bug" that statement had in mind.

Should I reroll the patch based on master?
- Brian Gesiak
[1] https://github.com/git/git/blob/4a28f169ad29ba452e0e7bea2583914c10c58322/Documentation/SubmittingPatches#L9
On Tue, May 27, 2014 at 8:11 AM, Jeremiah Mahler <jmmahler@gmail.com> wrote:
Show 36 quoted lines
> Brian,
>
> On Tue, May 27, 2014 at 12:33:42AM +0900, Brian Gesiak wrote:
>> xcalloc takes two arguments: the number of elements and their size.
>> run_add_interactive passes the arguments in reverse order, passing the
>> size of a char*, followed by the number of char* to be allocated.
>> Rearrgange them so they are in the correct order.
>>
>> Signed-off-by: Brian Gesiak <modocache@gmail.com>
>> ---
>>  builtin/add.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/builtin/add.c b/builtin/add.c
>> index 672adc0..488acf4 100644
>> --- a/builtin/add.c
>> +++ b/builtin/add.c
>> @@ -248,7 +248,7 @@ int run_add_interactive(const char *revision, const char *patch_mode,
>>       int status, ac, i;
>>       const char **args;
>>
>> -     args = xcalloc(sizeof(const char *), (pathspec->nr + 6));
>> +     args = xcalloc((pathspec->nr + 6), sizeof(const char *));
>>       ac = 0;
>>       args[ac++] = "add--interactive";
>>       if (patch_mode)
>>
>
> This patch doesn't apply to any of the branches I have available
> (master, pu, next).  And there is no line containing "pathspec->nr + 6"
> anywhere in my builtin/add.c.  Which branch is your work based off?
>
> --
> Jeremiah Mahler
> jmmahler@gmail.com
> http://github.com/jmahler
Previous: Jeremiah MahlerNext: Jeremiah Mahler
Message 4 of 28 in “Rearrange xcalloc arguments”
  1. 00/15 Rearrange xcalloc argumentsBrian Gesiak, May 26, 2014
  2. 01/15 builtin/add.c: rearrange xcalloc argumentsBrian Gesiak, May 26, 2014
  3. Jeremiah MahlerMay 26, 2014
  4. Brian GesiakMay 27, 2014
  5. Jeremiah MahlerMay 27, 2014
  6. Eric SunshineMay 27, 2014
  7. Brian GesiakMay 27, 2014
  8. Eric SunshineMay 27, 2014
  9. Junio C HamanoMay 27, 2014
  10. Jeremiah MahlerMay 28, 2014
  11. Brian GesiakMay 28, 2014
  12. 02/15 builtin/ls-remote.c: rearrange xcalloc argumentsBrian Gesiak, May 26, 2014
  13. 03/15 builtin/remote.c: rearrange xcalloc argumentsBrian Gesiak, May 26, 2014
  14. 04/15 commit.c: rearrange xcalloc argumentsBrian Gesiak, May 26, 2014
  15. 05/15 config.c: rearrange xcalloc argumentsBrian Gesiak, May 26, 2014
  16. 06/15 diff.c: rearrange xcalloc argumentsBrian Gesiak, May 26, 2014
  17. 07/15 hash.c: rearrange xcalloc argumentsBrian Gesiak, May 26, 2014
  18. 08/15 hash.h: rearrange xcalloc argumentsBrian Gesiak, May 26, 2014
  19. 09/15 http-push.c: rearrange xcalloc argumentsBrian Gesiak, May 26, 2014
  20. 10/15 imap-send.c: rearrange xcalloc argumentsBrian Gesiak, May 26, 2014
  21. Jeremiah MahlerJun 10, 2014
  22. 11/15 notes.c: rearrange xcalloc argumentsBrian Gesiak, May 26, 2014
  23. 12/15 pack-revindex.c: rearrange xcalloc argumentsBrian Gesiak, May 26, 2014
  24. 13/15 reflog-walk.c: rearrange xcalloc argumentsBrian Gesiak, May 26, 2014
  25. 14/15 remote.c: rearrange xcalloc argumentsBrian Gesiak, May 26, 2014
  26. 15/15 transport-helper.c: rearrange xcalloc argumentsBrian Gesiak, May 26, 2014
  27. Jeremiah MahlerMay 26, 2014
  28. Jeff KingMay 28, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.