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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Steffen Prohaska <prohaska@xxxxxx> writes:

> We want to verify if an autocrlf conversion is reversible only if
> the converted data is actually written to the repository.  Only
> in this case the file would be modified during the next checkout.
> But convert_to_git() is used for some other purposes.
> This commit adds a flag to convert_to_git() that controls if the
> safecrlf check is enabled...

At first this felt dirty to me as convert_to_git() is not
limited to crlf, but about external vs canonical representation.
The variable name being "checksafe" however makes it much more
palatable.  It is clear that it is talking about irreversible
conversion.

When running diff with a work tree file and the index (or a
named tree), we read the work tree file and run convert_to_git()
on it before comparing it with what we have in the object store
(either index or a named tree).  When running apply without
touching the index, we also use convert_to_git() on the work
tree file.  The patch file is supposed to record the data in
canonical format, I think.

Of course, "git add" on the path will warn or fail with your
patch, but we may somehow want to be warned about the breakage
before "git add" on that path triggers it.  Perhaps we can have
a separate "check-work-tree" command that iterates over locally
modified work tree files and runs convert_to_git() with checking
enabled.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux