From: Ben Boeckel <mathstuf@gmail.com>
To: "Torsten Bögershausen" <tboegi@web.de>
Cc: git@vger.kernel.org
Subject: Re: Cannot checkout after setting the eol attribute
Date: Wed, 23 Aug 2017 17:09:44 -0400 [thread overview]
Message-ID: <20170823210944.GA32462@megas.kitware.com> (raw)
In-Reply-To: <20170823194315.GA29237@tor.lan>
On Wed, Aug 23, 2017 at 21:43:15 +0200, Torsten Bögershausen wrote:
> git reset does it's job - please see below.
>
> The problem is that we need a "git commit" here.
> After applying .gitattributes, it may be neccessary to "normalize" the
> files. If there is something in the documentation, that can be
> improved, please let us know.
I'll have a patch up shortly.
> On Tue, Aug 22, 2017 at 03:44:41PM -0400, Ben Boeckel wrote:
> > The fact that plumbing is necessary to dig yourself out of a hole of the
> > `eol` attribute changes points to something needing to be changed, even
> > if it's only documentation. Could Git detect this and message about it
> > somehow when `git reset` cannot fix the working tree?
>
> The thing is, that the working tree is "in a good state":
> We want "dos" with CRLF, and that is what we have.
> There is nothing that can be improved in the working tree.
> What needs to be fixed, is the index. And that needs to be done with
> "git add" "git commit."
> As Junio pointed out, the read-tree is not ideal
> (to fix a single file in a possible dirty working tree)
>
> In your case it looks like this:
>
> echo "dos eol=crlf" > .gitattributes
> git add .gitattributes &&
> git rm --cached dos && git add dos &&
> git commit
In this case, just adding the file should work: the file is on-disk as
intended and adding the file should normalize the line endings when
adding it into the index (basically, just `git add dos` should be
required to make the index look like it should).
> > Or maybe it could at least exit with failure instead of success?
>
> I don't know.
> It -may- be possible to add a warning in "git reset".
> I can have a look at that...
Thanks.
--Ben
next prev parent reply other threads:[~2017-08-23 21:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-22 17:49 Cannot checkout after setting the eol attribute Ben Boeckel
2017-08-22 19:13 ` Torsten Bögershausen
2017-08-22 19:44 ` Ben Boeckel
2017-08-23 19:43 ` Torsten Bögershausen
2017-08-23 21:09 ` Ben Boeckel [this message]
2017-08-22 20:03 ` Junio C Hamano
2017-08-23 21:17 ` [PATCH] Documentation: mention that `eol` can change the dirty status of paths Ben Boeckel
2017-08-23 21:21 ` Ben Boeckel
2017-08-24 5:50 ` Torsten Bögershausen
2017-08-30 13:49 ` Ben Boeckel
2017-08-30 21:31 ` Junio C Hamano
2017-08-31 13:16 ` Ben Boeckel
2017-08-30 13:59 ` [PATCH v2] " Ben Boeckel
2017-08-31 13:19 ` [PATCH v3] " Ben Boeckel
2017-08-31 14:33 ` Torsten Bögershausen
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=20170823210944.GA32462@megas.kitware.com \
--to=mathstuf@gmail.com \
--cc=git@vger.kernel.org \
--cc=tboegi@web.de \
/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).