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

[PATCH 0/3] Refactor checkout option handling

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Aug 28, 2012, 13:49 UTC
Message-ID
<1346161748-25651-1-git-send-email-pclouds@gmail.com>
In-Reply-To
<7vr4qroel6.fsf@alter.siamese.dyndns.org>
On Tue, Aug 28, 2012 at 10:55 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> The surrounding code is somewhat tricky and the code structure is
> brittle; there are places that update the opts.new_branch so the new
> location of this check has to be after them, and there is one
> codepath that having a bad value in it does not matter.
>
> I had to check the code outside the context of this patch a few
> times to convince myself that this patch does not break them.  I'll
> queue the patch as-is for now, but we probably would want to see how
> we can structure it to be less brittle.

I'll give it a shot. On top of master, not the "checkout -b -t" patch. The test suite passes, but we'll need more eyeballs for code moves like this.

Nguyễn Thái Ngọc Duy (3):
  checkout: pass "struct checkout_opts *" as const pointer
  checkout: reorder option handling
  checkout: move branch guessing code out as a separate function
 builtin/checkout.c | 290 ++++++++++++++++++++++++++++++-----------------------
 1 file changed, 164 insertions(+), 126 deletions(-)
-- 
1.7.12.rc2.18.g61b472e
Previous: Junio C HamanoNext: Nguyễn Thái Ngọc Duy
Message 3 of 16 in “checkout: verify new branch name's validity early”
  1. checkout: verify new branch name's validity earlyNguyễn Thái Ngọc Duy, Aug 28, 2012
  2. Junio C HamanoAug 28, 2012
  3. 0/3 Refactor checkout option handlingNguyễn Thái Ngọc Duy, Aug 28, 2012
  4. 1/3 checkout: pass "struct checkout_opts *" as const pointerNguyễn Thái Ngọc Duy, Aug 28, 2012
  5. 2/3 checkout: reorder option handlingNguyễn Thái Ngọc Duy, Aug 28, 2012
  6. Junio C HamanoAug 28, 2012
  7. Nguyen Thai Ngoc DuyAug 29, 2012
  8. 1/3 checkout: pass "struct checkout_opts *" as const pointerNguyễn Thái Ngọc Duy, Aug 29, 2012
  9. 2/3 checkout: move more parameters to struct checkout_optsNguyễn Thái Ngọc Duy, Aug 29, 2012
  10. 3/3 checkout: reorder option handlingNguyễn Thái Ngọc Duy, Aug 29, 2012
  11. Junio C HamanoAug 29, 2012
  12. Junio C HamanoAug 29, 2012
  13. 3/3 checkout: reorder option handlingNguyễn Thái Ngọc Duy, Aug 30, 2012
  14. Junio C HamanoAug 30, 2012
  15. Junio C HamanoSep 7, 2012
  16. 3/3 checkout: move branch guessing code out as a separate functionNguyễn Thái Ngọc Duy, Aug 28, 2012

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.