Junio C Hamano <gitster@pobox.com> writes:Ok, let's step back a bit and I'll suggest an alternative approach to your 1/2. This would hopefully solve 2/2 without any code change your patch 2/2 has. I think this approach is very much in line with how the git plumbing works, but you would need to know how the world is designed to work in order to appreciate it fully. Let's have a few paragraphs to give the readers some background. The work tree side of git is primarily about the index, and what is on the work tree is more or less secondary. At the lower level, often we deliberately treat not having a working tree file as equivalent to having an unmodified work tree file. We can apply the same principle to this "missing .gitattributes file" case. People who only know modern git may not be aware of this, but you can apply patches and perform a merge in a work tree that does not have any file checked out, as long as your index is fully populated. For example, you can do something like this: $ git clone -n git://.../git.git v.git $ cd v.git $ git update-ref --no-deref HEAD $(git rev-parse v1.5.3-rc4^0) $ git read-tree HEAD $ git apply --index patch.txt You will have the files that are patched in the resulting work tree, so that you can inspect the result. If you like the result, you can even make a commit in such a sparsely populated tree: $ git commit Of course, "git commit -a" and "git add -u" Porcelain options are more recent inventions, and they would not work with such a sparsely populated work tree. But the above demonstration shows that at the plumbing level the index is the king and the work tree is secondary, and this is very much as designed. The merge operation has similar characteristics: $ git merge master ... will check out the paths that need file-level 3-way merge, so that you can inspect the result, but what you will have is a sparsely populated work tree, and this is as designed. Currently, the attr_stack code reads only from the work tree and work tree alone. We could change it to: - If the directory on the work tree has .gitattributes, use it (this is what the current code does); - Otherwise if the index has .gitattributes at the corresponding path, use that instead. This essentially treats not having .gitattributes files checked out as equivalent to having these files checked out unmodified, which is very much in line with how the world is designed to work. - 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
| Dmitry Torokhov | 2.6.27-rc8+ - first impressions |
| Greg KH | [patch 00/28] 2.6.25-stable review |
| Linus Torvalds | Linux 2.6.27-rc8 |
| Jan Kundrát | kswapd high CPU usage with no swap |
git: | |
| Ken Pratt | pack operation is thrashing my server |
| ir0s | Local branch ahead of tracked remote branch but git push claims everything up-to-d... |
| Wink Saville | Resolving conflicts |
| Olivier Marin | [PATCH] builtin-rerere: fix conflict markers parsing |
| Samuel Moñux | Cyrus IMAP performance problems [Long] |
| Richard Stallman | Real men don't attack straw men |
| Didier Wiroth | how can I "find xyz | xargs tar" ... like gtar |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Volker Armin Hemmann | build error with 2.6.27.6+reiser4+ehci-hub patch. ERROR: "mii_ethtool_gset" [drive... |
| Frithjof Hammer | Re: [LARTC] ifb and ppp |
| David Miller | [GIT]: Networking |
| David Madore | atl1e Ethernet driver not seeing packets sent to 33:33:00:00:00:01 multicast |
| Block Sub System query | 2 hours ago | Linux kernel |
| kernel module to intercept socket creation | 3 hours ago | Linux kernel |
| Image size changing during each build | 3 hours ago | Linux kernel |
| Soft lock bug | 8 hours ago | Linux kernel |
| sysctl - dynamic registration problem | 14 hours ago | Linux kernel |
| Question on swap as ramdisk partition | 17 hours ago | Linux kernel |
| serial driver xmit problem | 21 hours ago | Linux kernel |
| Generic Netlink subsytem | 22 hours ago | Linux kernel |
| 'Report spam filter error' page broken | 1 day ago | KernelTrap Suggestions and Feedback |
| Netfilter kernel module | 1 day ago | Linux kernel |
