git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Joey Hess <id@joeyh.name>
To: git@vger.kernel.org
Subject: git cat-file --batch surprising carriage return behavior
Date: Tue, 8 Oct 2019 15:22:57 -0400	[thread overview]
Message-ID: <20191008192257.GA16870@kitenet.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 668 bytes --]

I'm surprised to find that git cat-file --batch, on a Linux system,
strips the \r from an input like "HEAD:foo\r\n"

It's obvious, of course, that it will remove the newline, and so this
interface cannot be used to query about a filename that, for some
horrible reason[1], contains a newline. But very surprising that it
cannot be used for filename that contains a carriage return, at least
on a non-Windows system.

The docs for cat-file --batch say the list of objects is separated by
linefeeds. I don't know if updating the docs is the best fix.
(I'd be happy to use a -z if it had one.)

-- 
see shy jo

[1] aka "a large enough number of monkeys"

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

             reply	other threads:[~2019-10-08 19:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-08 19:22 Joey Hess [this message]
2019-10-08 20:00 ` git cat-file --batch surprising carriage return behavior Jeff King
2019-10-09 15:28   ` Joey Hess
2019-10-11  6:21     ` Jeff King

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20191008192257.GA16870@kitenet.net \
    --to=id@joeyh.name \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).