Re: how to revert changes in working tree?

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

 



Liu Yubao writes:
 > Yes, you are very right.
 > 
 > $ git ls-files |tr A-Z a-z | sort | uniq -c |grep -v "1 "
 >       2 include/linux/netfilter/xt_connmark.h
 >       2 include/linux/netfilter/xt_dscp.h
 >       2 include/linux/netfilter/xt_mark.h
 >       2 include/linux/netfilter_ipv4/ipt_connmark.h
 >       2 include/linux/netfilter_ipv4/ipt_dscp.h
 >       2 include/linux/netfilter_ipv4/ipt_ecn.h
 >       2 include/linux/netfilter_ipv4/ipt_mark.h
 >       2 include/linux/netfilter_ipv4/ipt_tcpmss.h
 >       2 include/linux/netfilter_ipv4/ipt_tos.h
 >       2 include/linux/netfilter_ipv4/ipt_ttl.h
 >       2 include/linux/netfilter_ipv6/ip6t_hl.h
 >       2 include/linux/netfilter_ipv6/ip6t_mark.h
 >       2 net/ipv4/netfilter/ipt_ecn.c
 >       2 net/ipv4/netfilter/ipt_tos.c
 >       2 net/ipv4/netfilter/ipt_ttl.c
 >       2 net/ipv6/netfilter/ip6t_hl.c
 >       2 net/netfilter/xt_connmark.c
 >       2 net/netfilter/xt_dscp.c
 >       2 net/netfilter/xt_mark.c
 > 
 > poor Windows... :-(

Incidentally I have this in my tree for a while, but it is not good
enough for general use, because you really need the original (not
lowercased) file names to resolve the problem. But my shell scripting
magic is not up to that task.

diff --git a/templates/hooks--pre-commit b/templates/hooks--pre-commit
index 723a9ef..0ceb01b 100644
--- a/templates/hooks--pre-commit
+++ b/templates/hooks--pre-commit
@@ -7,6 +7,17 @@
 #
 # To enable this hook, make this file executable.

+# Detect case challenges
+
+case_challenge=`git ls-files | tr A-Z a-z | sort | uniq -d`
+if [ -n "$case_challenge" ]
+then
+       echo >&2 "index contains file names differing only in case."
+       echo >&2 "lowercase names follow:"
+       echo >&2 "$case_challenge"
+       exit 1
+fi
+
 # This is slightly modified from Andrew Morton's Perfect Patch.
 # Lines you introduce should not have trailing whitespace.
 # Also check for an indentation that has SP before a TAB.

-
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]