All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Michael Henry <git@drmikehenry.com>, git@vger.kernel.org
Subject: [PATCH 0/5] handling "-" as stdin/stdout in git bundle
Date: Sat, 4 Mar 2023 05:22:40 -0500	[thread overview]
Message-ID: <ZAMb8LSpm2gOrpeY@coredump.intra.peff.net> (raw)
In-Reply-To: <ZAKi8MzGWk5PZUJk@coredump.intra.peff.net>

On Fri, Mar 03, 2023 at 08:46:24PM -0500, Jeff King wrote:

> > I wasn't thinking of changing the behavior for input, but just focusing
> > the docs in the right spot (the "create" option), like:
> 
> Oh, hmph. I didn't realize that both my patch and yours are touching a
> shared options-parser that affects both reading and writing. So the
> patch by itself is fixing "git bundle create -" but breaking "git bundle
> verify -". We either need to teach the reading side to handle "-", or we
> have to teach parse_options_cmd_bundle() to handle the two cases
> differently.

So here's a potential series. It does teach "-" to the reading side.
Which is technically a behavior change, but one that I hope people will
find pretty reasonable.

The patches are:

  [1/5]: bundle: let "-" mean stdin for reading operations

    Does what it says. I did it as a preparatory patch before yours, so
    that there's never a state where we are treating "-" as special for
    prefixing but it doesn't actually work yet. :-/

  [2/5]: bundle: document handling of "-" as stdin

    One half of the doc-fixes discussed earlier, but of course covering
    all operations now.

  [3/5]: bundle: don't blindly apply prefix_filename() to "-"

    Your patch, but rebased and with the comment above fix_filename()
    dropped (since it's handled below). I saw you prepared yours on
    "maint". I did this one on "master", because some of the
    leak-handling in the other patches needs it. Since this has been
    broken for ages, and since "master" is about to become "maint" when
    2.40 release in a few days, it seemed simpler to just wait. But if
    we really want to, I think we could reorder and split it into two
    topics.

  [4/5]: parse-options: consistently allocate memory in fix_filename()

    Leak-fixes that also get us ready for using your new helper. :)

  [5/5]: parse-options: use prefix_filename_except_for_dash() helper

    And using the new helper. This could arguably be squashed into 4,
    but I wasn't sure at the outset what order to do it in (another
    option is putting 4 earlier, and then just converting it over in
    your patch 3).

 Documentation/git-bundle.txt        |  8 +++++---
 abspath.c                           |  7 +++++++
 builtin/archive.c                   |  3 ++-
 builtin/bundle.c                    | 28 +++++++++++++++++++++++-----
 builtin/checkout.c                  |  3 ++-
 builtin/reset.c                     |  4 +++-
 builtin/tag.c                       |  4 +++-
 cache.h                             |  3 +++
 parse-options.c                     | 12 ++++++------
 t/helper/test-parse-pathspec-file.c |  3 ++-
 t/t6020-bundle-misc.sh              | 26 ++++++++++++++++++++++++++
 11 files changed, 82 insertions(+), 19 deletions(-)

-Peff

  reply	other threads:[~2023-03-04 10:22 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-25 12:58 `git bundle create -` may not write to `stdout` Michael Henry
2023-02-26 23:16 ` Jeff King
2023-03-03 22:31   ` Junio C Hamano
2023-03-03 22:54     ` Jeff King
2023-03-03 23:05       ` Junio C Hamano
2023-03-04  1:28         ` Jeff King
2023-03-04  1:46           ` Jeff King
2023-03-04 10:22             ` Jeff King [this message]
2023-03-04 10:26               ` [PATCH 1/5] bundle: let "-" mean stdin for reading operations Jeff King
2023-03-04 10:26               ` [PATCH 2/5] bundle: document handling of "-" as stdin Jeff King
2023-03-04 10:27               ` [PATCH 3/5] bundle: don't blindly apply prefix_filename() to "-" Jeff King
2023-03-04 10:31               ` [PATCH 4/5] parse-options: consistently allocate memory in fix_filename() Jeff King
2023-03-04 10:31               ` [PATCH 5/5] parse-options: use prefix_filename_except_for_dash() helper Jeff King
2023-03-04 10:55               ` [RFC/PATCH] bundle: turn on --all-progress-implied by default Jeff King
2023-03-06  3:44                 ` Robin H. Johnson
2023-03-06  5:38                   ` Jeff King
2023-03-06  9:25                     ` Jeff King
2023-03-06 17:41                 ` Junio C Hamano
2023-03-06 17:34             ` `git bundle create -` may not write to `stdout` Junio C Hamano
2023-03-04  1:14       ` Junio C Hamano
2023-03-04  1:43         ` Jeff King
2023-03-03 23:59     ` Michael Henry
2023-03-04  2:22       ` Jeff King
2023-03-04 10:08         ` Michael Henry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZAMb8LSpm2gOrpeY@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@drmikehenry.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.