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

[PATCH v2 0/4] pack-objects: use revision.c's --stdin parsing

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jun 17, 2021, 10:57 UTC
Message-ID
<cover-0.4-0000000000-20210617T105537Z-avarab@gmail.com>
In-Reply-To
<cover-0.4-0000000000-20210608T121008Z-avarab@gmail.com>

A re-roll of https://lore.kernel.org/git/cover-0.4-0000000000-20210608T121008Z-avarab@gmail.com/

Fixes whitespace issues in v1, and uses the named enums I added instead of their implicit values in the documentation. I also conflated BREAK and CONTINUE in that same explanation.

Ævar Arnfjörð Bjarmason (4):
  upload-pack: run is_repository_shallow() before setup_revisions()
  revision.h: unify "disable_stdin" and "read_from_stdin"
  pack-objects.c: do stdin parsing via revision.c's API
  pack-objects.c: make use of REV_INFO_STDIN_LINE_PROCESS
 builtin/am.c           |  4 +--
 builtin/blame.c        |  2 +-
 builtin/diff-tree.c    |  2 +-
 builtin/pack-objects.c | 64 +++++++++++++++++++---------------------
 builtin/rev-list.c     |  2 +-
 revision.c             | 35 +++++++++++++++++++---
 revision.h             | 66 ++++++++++++++++++++++++++++++++++++++----
 sequencer.c            |  4 +--
 8 files changed, 129 insertions(+), 50 deletions(-)
Range-diff against v1:
1:  c56a302e09 = 1:  6a8b20a7cf upload-pack: run is_repository_shallow() before setup_revisions()
2:  002e0f1cf7 = 2:  d88b2c0410 revision.h: unify "disable_stdin" and "read_from_stdin"
3:  1a9eb26587 ! 3:  d433d7b24a pack-objects.c: do stdin parsing via revision.c's API
    @@ revision.c: static void read_revisions_from_stdin(struct rev_info *revs,
     +			int do_break = 0;
     +			enum rev_info_stdin_line ret = revs->handle_stdin_line(
     +				revs, &sb, revs->stdin_line_priv);
    -+	
    ++
     +			switch (ret) {
     +			case REV_INFO_STDIN_LINE_PROCESS:
     +				break;
    @@ revision.h: struct rev_info {
     +	 * When reading from stdin (see "stdin_handling" above) define
     +	 * a handle_stdin_line function to consume the lines.
     +	 *
    -+	 * - Return 0 to continue revision.c's normal processing of the
    -+	 *   line (after possibly munging the provided strbuf).
    ++	 * - Return REV_INFO_STDIN_LINE_PROCESS to continue
    ++	 *   revision.c's normal processing of the line (after
    ++	 *   possibly munging the provided strbuf).
     +	 *
    -+	 * - Return 1 to indicate that the line is fully processed,
    -+         *   moving onto the next line (if any)
    ++	 * - Return REV_INFO_STDIN_LINE_BREAK to process no further
    ++	 *   lines, or anything further from the current line (just
    ++	 *   like REV_INFO_STDIN_LINE_CONTINUE).
     +	 *
    -+	 * - Return 2 to process no further lines.
    ++	 * - Return REV_INFO_STDIN_LINE_CONTINUE to indicate that the
    ++	 *   line is fully processed, moving onto the next line (if
    ++	 *   any)
     +	 *
     +	 * Use the "stdin_line_priv" to optionally pass your own data
     +	 * around.
4:  15a3a5d047 ! 4:  e59a06c314 pack-objects.c: make use of REV_INFO_STDIN_LINE_PROCESS
    @@ revision.c: static void read_revisions_from_stdin(struct rev_info *revs,
     
      ## revision.h ##
     @@ revision.h: struct rev_info {
    - 	 * - Return 0 to continue revision.c's normal processing of the
    - 	 *   line (after possibly munging the provided strbuf).
    + 	 *   revision.c's normal processing of the line (after
    + 	 *   possibly munging the provided strbuf).
      	 *
     +	 *   Change "revarg_flags" to affect the subsequent handling
     +	 *   in handle_revision_arg()
     +	 *
    - 	 * - Return 1 to indicate that the line is fully processed,
    -          *   moving onto the next line (if any)
    + 	 * - Return REV_INFO_STDIN_LINE_BREAK to process no further
    + 	 *   lines, or anything further from the current line (just
    + 	 *   like REV_INFO_STDIN_LINE_CONTINUE).
    + 	 *
    + 	 * - Return REV_INFO_STDIN_LINE_CONTINUE to indicate that the
    ++	 *
    ++	 * - Return REV_INFO_STDIN_LINE_BREAK to indicate that the
    + 	 *   line is fully processed, moving onto the next line (if
    + 	 *   any)
      	 *
     @@ revision.h: struct rev_info {
      	 * around.
-- 
2.32.0.571.gdba276db2c
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 7 of 35 in “pack-objects: use revision.c's --stdin parsing”
  1. 0/4 pack-objects: use revision.c's --stdin parsingÆvar Arnfjörð Bjarmason, Jun 8, 2021
  2. 2/4 revision.h: unify "disable_stdin" and "read_from_stdin"Ævar Arnfjörð Bjarmason, Jun 8, 2021
  3. 3/4 pack-objects.c: do stdin parsing via revision.c's APIÆvar Arnfjörð Bjarmason, Jun 8, 2021
  4. Junio C HamanoJun 9, 2021
  5. 1/4 upload-pack: run is_repository_shallow() before setup_revisions()Ævar Arnfjörð Bjarmason, Jun 8, 2021
  6. 4/4 pack-objects.c: make use of REV_INFO_STDIN_LINE_PROCESSÆvar Arnfjörð Bjarmason, Jun 8, 2021
  7. 0/4 pack-objects: use revision.c's --stdin parsingÆvar Arnfjörð Bjarmason, Jun 17, 2021
  8. 1/4 upload-pack: run is_repository_shallow() before setup_revisions()Ævar Arnfjörð Bjarmason, Jun 17, 2021
  9. 2/4 revision.h: unify "disable_stdin" and "read_from_stdin"Ævar Arnfjörð Bjarmason, Jun 17, 2021
  10. Emily ShafferJun 17, 2021
  11. Jonathan TanJun 18, 2021
  12. 3/4 pack-objects.c: do stdin parsing via revision.c's APIÆvar Arnfjörð Bjarmason, Jun 17, 2021
  13. Jonathan TanJun 18, 2021
  14. 4/4 pack-objects.c: make use of REV_INFO_STDIN_LINE_PROCESSÆvar Arnfjörð Bjarmason, Jun 17, 2021
  15. 0/4 pack-objects: use revision.c's --stdin parsingÆvar Arnfjörð Bjarmason, Jun 21, 2021
  16. 1/4 upload-pack: run is_repository_shallow() before setup_revisions()Ævar Arnfjörð Bjarmason, Jun 21, 2021
  17. 3/4 pack-objects.c: do stdin parsing via revision.c's APIÆvar Arnfjörð Bjarmason, Jun 21, 2021
  18. Junio C HamanoJul 8, 2021
  19. 2/4 revision.h: refactor "disable_stdin" and "read_from_stdin"Ævar Arnfjörð Bjarmason, Jun 21, 2021
  20. Junio C HamanoJul 8, 2021
  21. 4/4 pack-objects.c: make use of REV_INFO_STDIN_LINE_PROCESSÆvar Arnfjörð Bjarmason, Jun 21, 2021
  22. Junio C HamanoJul 8, 2021
  23. 0/5 revision.[ch]: add --stdin parsing API, use in pack-objectsÆvar Arnfjörð Bjarmason, Jul 9, 2021
  24. 1/5 upload-pack: run is_repository_shallow() before setup_revisions()Ævar Arnfjörð Bjarmason, Jul 9, 2021
  25. 2/5 revision.h: refactor "disable_stdin" and "read_from_stdin"Ævar Arnfjörð Bjarmason, Jul 9, 2021
  26. Junio C HamanoJul 9, 2021
  27. 4/5 pack-objects.c: do stdin parsing via revision.c's APIÆvar Arnfjörð Bjarmason, Jul 9, 2021
  28. 5/5 pack-objects.c: make use of REV_INFO_STDIN_LINE_PROCESSÆvar Arnfjörð Bjarmason, Jul 9, 2021
  29. 3/5 revision.[ch]: add a "handle_stdin_line" APIÆvar Arnfjörð Bjarmason, Jul 9, 2021
  30. 0/5 add --stdin parsing API, use in pack-objectsÆvar Arnfjörð Bjarmason, Jul 26, 2021
  31. 1/5 upload-pack: run is_repository_shallow() before setup_revisions()Ævar Arnfjörð Bjarmason, Jul 26, 2021
  32. 5/5 pack-objects.c: make use of REV_INFO_STDIN_LINE_PROCESSÆvar Arnfjörð Bjarmason, Jul 26, 2021
  33. 2/5 revision.h: refactor "disable_stdin" and "read_from_stdin"Ævar Arnfjörð Bjarmason, Jul 26, 2021
  34. 4/5 pack-objects.c: do stdin parsing via revision.c's APIÆvar Arnfjörð Bjarmason, Jul 26, 2021
  35. 3/5 revision.[ch]: add a "handle_stdin_line" APIÆvar Arnfjörð Bjarmason, Jul 26, 2021

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.