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

Re: [PATCH] safecrlf: Add flag to convert_to_git() to disable safecrlf check

From
Dmitry Potapov <dpotapov@gmail.com>
Date
Jan 15, 2008, 23:03 UTC
Message-ID
<20080115230312.GB13984@dpotapov.dyndns.org>
In-Reply-To
<53A4FB98-25B5-4598-BED8-7D96AF5527F4@zib.de>
On Tue, Jan 15, 2008 at 09:39:00PM +0100, Steffen Prohaska wrote:
Show 10 quoted lines
> 
> On Jan 15, 2008, at 11:26 AM, Dmitry Potapov wrote:
> 
> >but it also means that there is no longer
> >any warning when you are running git diff with the work tree,
> >which would be useful, because it is what most users do before
> >adding anything.
> 
> My first concern is to avoid data corruption.  But we should also
> avoid to unnecessarily bother users with annoying warnings. 

I don't think we bother users with unnecessary warnings. If there is a problem then it is better to report it earlier than later, and we *really* want that the user took some action, i.e. either to mark this file as binary using .gitattributes or corrected its endings. However, reporting the same problem twice during running one command does not look nice...

> Thus
> I thought that guarding only the code paths that modify data in
> an irreversible way is sufficient and hence I only guarded the
> code path that writes to the repository.

This policy makes sense to me, it is just I would prefer if we could find a way to warn a user a bit earlier...

> The underlying
> assumption is that git checkout is the only way of destroying the
> original data.  Unless you check out you still have the original
> data and can copy them to a safe place.

It is obvious to you but it may be not so obvious to a new user. Running 'git diff' before check in is a common practice, so if the warning was reported at that moment then he or she would not check in.

Anyway, I like your solution for being simple and guarding the most important pass reliably.

Dmitry
Previous: Steffen Prohaska
Message 15 of 15 in “safecrlf: Add mechanism to warn about irreversible crlf conversions”
  1. safecrlf: Add mechanism to warn about irreversible crlf conversionsSteffen Prohaska, Jan 13, 2008
  2. Dmitry PotapovJan 13, 2008
  3. Dmitry PotapovJan 13, 2008
  4. Don't display crlf warning twiceDmitry Potapov, Jan 13, 2008
  5. Steffen ProhaskaJan 14, 2008
  6. Dmitry PotapovJan 14, 2008
  7. Steffen ProhaskaJan 14, 2008
  8. safecrlf: Add flag to convert_to_git() to disable safecrlf checkSteffen Prohaska, Jan 14, 2008
  9. Junio C HamanoJan 14, 2008
  10. Steffen ProhaskaJan 15, 2008
  11. Steffen ProhaskaJan 15, 2008
  12. Junio C HamanoJan 15, 2008
  13. Dmitry PotapovJan 15, 2008
  14. Steffen ProhaskaJan 15, 2008
  15. Dmitry PotapovJan 15, 2008

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.