From: Junio C Hamano <gitster@pobox.com>
To: "Quim K. Holland" <qkholland@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git cat-file blob does not convert crlf
Date: Wed, 26 Nov 2008 11:42:17 -0800 [thread overview]
Message-ID: <7v3ahegtpi.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20081127013456.6117@qkholland.gmail.com> (Quim K. Holland's message of "Thu, 27 Nov 2008 01:34:56 +0600")
"Quim K. Holland" <qkholland@gmail.com> writes:
> I think git is buggy.
Thanks for pointing it out X-<.
> I wanted to discard the changes I made to my file by checking out a copy from the last commit, so I said
> % git cat-file blob HEAD:my-file >my-file
> But this does not respect core.autocrlf and the file becomes one long line.
That is pretty much intentional. cat-file is a low-level command that is
meant to inspect the raw object contents. The output from the command has
to be reproducible regardless of what customization you have in your
particular repository and omission of attributes support (including the
crlf conversion) is quite deliberate.
You said that you wanted to discard the changes by checking out a copy out
of the HEAD commit. This can literally be done by:
$ git checkout HEAD my-file
If you want to check out a copy out of the index (i.e, "the last staged
version"), you can say:
$ git checkout my-file
In other words, if you want to checkout, you can say checkout ;-)
next prev parent reply other threads:[~2008-11-26 19:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-26 19:34 git cat-file blob does not convert crlf Quim K. Holland
2008-11-26 19:42 ` Junio C Hamano [this message]
2008-11-27 1:41 ` Johannes Schindelin
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=7v3ahegtpi.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=qkholland@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox