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

Re: [PATCH 6/6] apply, ls-files: simplify "-z" parsing

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 1, 2016, 22:52 UTC
Message-ID
<xmqqio28t55d.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<xmqqzivkt86j.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
> Of course, a patch adding a "--nul" can be the one that does the
> polarity flipping, so in that sense, this simplification is probably
> OK, as long as there is some comment that warns a time-bomb you just
> planted here ;-)
I'll queue it with this tweak for now.

The idea is to have them run "blame" to find the last paragraph of the commit log message.

Thanks.
    From: Jeff King <peff@peff.net>
    Date: Sun, 31 Jan 2016 06:35:46 -0500
    Subject: [PATCH] apply, ls-files: simplify "-z" parsing
    As a short option, we cannot handle negation. Thus a callback
    handling "unset" is overkill, and we can just use OPT_SET_INT
    instead to handle setting the option.
 +  Anybody who adds "--nul" synonym to this later would need to be
 +  careful not to break "--no-nul", which should mean that lines are
 +  terminated with LF at the end.
    Signed-off-by: Jeff King <peff@peff.net>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff --git a/builtin/apply.c b/builtin/apply.c
index 565f3fd..d61ac65 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -4536,6 +4536,7 @@ int cmd_apply(int argc, const char **argv, const char *prefix_)
 			 N_( "attempt three-way merge if a patch does not apply")),
 		OPT_FILENAME(0, "build-fake-ancestor", &fake_ancestor,
 			N_("build a temporary index based on embedded index information")),
+		/* Think twice before adding "--nul" synonym to this */
 		OPT_SET_INT('z', NULL, &line_termination,
 			N_("paths are separated with NUL character"), '\0'),
 		OPT_INTEGER('C', NULL, &p_context,
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index 59bad9b..467699b 100644
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
@@ -400,6 +400,7 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
 	struct exclude_list *el;
 	struct string_list exclude_list = STRING_LIST_INIT_NODUP;
 	struct option builtin_ls_files_options[] = {
+		/* Think twice before adding "--nul" synonym to this */
 		OPT_SET_INT('z', NULL, &line_terminator,
 			N_("paths are separated with NUL character"), '\0'),
 		OPT_BOOL('t', NULL, &show_tag,
Previous: Junio C HamanoNext: Jeff King
Message 17 of 19 in “post-strbuf_getline cleanups”
  1. 0/6 post-strbuf_getline cleanupsJeff King, Jan 31, 2016
  2. 1/6 give "nbuf" strbuf a more meaningful nameJeff King, Jan 31, 2016
  3. Johannes SchindelinJan 31, 2016
  4. Jeff KingJan 31, 2016
  5. Johannes SchindelinJan 31, 2016
  6. 2/6 checkout-index: simplify "-z" option parsingJeff King, Jan 31, 2016
  7. 3/6 checkout-index: handle "--no-prefix" optionJeff King, Jan 31, 2016
  8. 4/6 checkout-index: handle "--no-index" optionJeff King, Jan 31, 2016
  9. Junio C HamanoFeb 1, 2016
  10. Jeff KingFeb 1, 2016
  11. 5/6 checkout-index: disallow "--no-stage" optionJeff King, Jan 31, 2016
  12. Junio C HamanoFeb 1, 2016
  13. Jeff KingFeb 1, 2016
  14. 6/6 apply, ls-files: simplify "-z" parsingJeff King, Jan 31, 2016
  15. Johannes SchindelinJan 31, 2016
  16. Junio C HamanoFeb 1, 2016
  17. Junio C HamanoFeb 1, 2016
  18. Jeff KingFeb 2, 2016
  19. Junio C HamanoFeb 1, 2016

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.