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

Re: [RFC/ PATCH] revert: Allow arbitrary sequencer instructions

From
Christian Couder <christian.couder@gmail.com>
Date
Aug 2, 2011, 07:52 UTC
Message-ID
<CAP8UFD367s-0gSbmX7N3Ddakc1cZxWb_eU-+Uy5Vr0gbY8m8SA@mail.gmail.com>
In-Reply-To
<1312260884-5087-2-git-send-email-artagnon@gmail.com>
Hi Ram,
On Tue, Aug 2, 2011 at 6:54 AM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:
Show 14 quoted lines
>
>        if (get_sha1(sha1_abbrev, commit_sha1) < 0)
>                return NULL;
>
> -       return lookup_commit_reference(commit_sha1);
> +       commit = lookup_commit_reference(commit_sha1);
> +       if (commit) {
> +               insn = xmalloc(sizeof(struct replay_insn));
> +               insn->commit = commit;
> +               insn->action = action;
> +               return insn;
> +       }
> +       return NULL;
>  }
I'd suggest:
       commit = lookup_commit_reference(commit_sha1);
       if (!commit)
               return NULL;
       insn = xmalloc(sizeof(struct replay_insn));
       insn->commit = commit;
       insn->action = action;
       return insn;

Thanks, Christian.

Previous: Ramkumar RamachandraNext: Jonathan Nieder
Message 3 of 6 in “[GSoC update] Iterating over a stable series”
  1. Ramkumar RamachandraAug 2, 2011
  2. revert: Allow arbitrary sequencer instructionsRamkumar Ramachandra, Aug 2, 2011
  3. Christian CouderAug 2, 2011
  4. Jonathan NiederAug 2, 2011
  5. Ramkumar RamachandraAug 3, 2011
  6. Ramkumar RamachandraAug 2, 2011

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.