login
Header Space

 
 

Re: how to revert changes in working tree?

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Liu Yubao <yubao.liu@...>
Cc: Shawn Pearce <spearce@...>, Alex Riesen <raa.lkml@...>, <git@...>
Date: Thursday, December 7, 2006 - 3:15 am

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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
how to revert changes in working tree?, Liu Yubao, (Wed Dec 6, 2:49 am)
Re: how to revert changes in working tree?, Alex Riesen, (Wed Dec 6, 4:43 am)
Re: how to revert changes in working tree?, Liu Yubao, (Wed Dec 6, 5:57 am)
Re: how to revert changes in working tree?, Alex Riesen, (Wed Dec 6, 6:20 am)
Re: how to revert changes in working tree?, Liu Yubao, (Wed Dec 6, 7:14 am)
Re: how to revert changes in working tree?, Shawn Pearce, (Wed Dec 6, 2:13 pm)
Re: how to revert changes in working tree?, Liu Yubao, (Wed Dec 6, 9:42 pm)
Re: how to revert changes in working tree?, Juergen Ruehle, (Thu Dec 7, 3:15 am)
Re: how to revert changes in working tree?, Alex Riesen, (Wed Dec 6, 8:30 am)
speck-geostationary