)]}' { "commit": "c0192df6306d4d9ad77f6015a053925b13155834", "tree": "bf6240c3b988240c871ee132b0cc9ccdb883ac99", "parents": [ "95e7c385393488cb20c29697d8655f94ce83c413" ], "author": { "name": "Jacob Keller", "email": "jacob.keller@gmail.com", "time": "Wed Sep 30 14:25:29 2020 -0700" }, "committer": { "name": "Junio C Hamano", "email": "gitster@pobox.com", "time": "Wed Sep 30 14:52:00 2020 -0700" }, "message": "refspec: add support for negative refspecs\n\nBoth fetch and push support pattern refspecs which allow fetching or\npushing references that match a specific pattern. Because these patterns\nare globs, they have somewhat limited ability to express more complex\nsituations.\n\nFor example, suppose you wish to fetch all branches from a remote except\nfor a specific one. To allow this, you must setup a set of refspecs\nwhich match only the branches you want. Because refspecs are either\nexplicit name matches, or simple globs, many patterns cannot be\nexpressed.\n\nAdd support for a new type of refspec, referred to as \"negative\"\nrefspecs. These are prefixed with a \u0027^\u0027 and mean \"exclude any ref\nmatching this refspec\". They can only have one \"side\" which always\nrefers to the source. During a fetch, this refers to the name of the ref\non the remote. During a push, this refers to the name of the ref on the\nlocal side.\n\nWith negative refspecs, users can express more complex patterns. For\nexample:\n\n git fetch origin refs/heads/*:refs/remotes/origin/* ^refs/heads/dontwant\n\nwill fetch all branches on origin into remotes/origin, but will exclude\nfetching the branch named dontwant.\n\nRefspecs today are commutative, meaning that order doesn\u0027t expressly\nmatter. Rather than forcing an implied order, negative refspecs will\nalways be applied last. That is, in order to match, a ref must match at\nleast one positive refspec, and match none of the negative refspecs.\nThis is similar to how negative pathspecs work.\n\nSigned-off-by: Jacob Keller \u003cjacob.keller@gmail.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n", "tree_diff": [ { "type": "modify", "old_id": "95ea84990298bf2c0e0dc4b03ee53e3563018a6c", "old_mode": 33188, "old_path": "Documentation/pull-fetch-param.txt", "new_id": "95a7390b2c78bddfc2c094fa6f0ba82e2b6de417", "new_mode": 33188, "new_path": "Documentation/pull-fetch-param.txt" }, { "type": "modify", "old_id": "c49f0e975203b039cbcf2ccab9860904f3f67e47", "old_mode": 33188, "old_path": "builtin/fetch.c", "new_id": "310699eb7e4517e35f52c1d0b3e3e3324aadc692", "new_mode": 33188, "new_path": "builtin/fetch.c" }, { "type": "modify", "old_id": "f10ef284cef95aef60b8b485f5909ba9a8c76b50", "old_mode": 33188, "old_path": "refspec.c", "new_id": "6350100c7c263875e7a000512144eeb80d0ce3a5", "new_mode": 33188, "new_path": "refspec.c" }, { "type": "modify", "old_id": "8d654e3a3ac40940c7d05f7ce671f538b7d250f2", "old_mode": 33188, "old_path": "refspec.h", "new_id": "e5bf6d25d0f72d83818a75651d39c090b9e46336", "new_mode": 33188, "new_path": "refspec.h" }, { "type": "modify", "old_id": "c5ed74f91c63b090ddd916c4fa235a0ebf62f558", "old_mode": 33188, "old_path": "remote.c", "new_id": "dad3b793321128f881517f486d760e331c57befe", "new_mode": 33188, "new_path": "remote.c" }, { "type": "modify", "old_id": "5e3ea5a26deb1d0db7deb6ff9ed2f3ef778084d4", "old_mode": 33188, "old_path": "remote.h", "new_id": "104e75e0f74dc301cda7f90a1e6c710ce681d196", "new_mode": 33188, "new_path": "remote.h" }, { "type": "add", "old_id": "0000000000000000000000000000000000000000", "old_mode": 0, "old_path": "/dev/null", "new_id": "8c61e28fec85e9f4e534019e6a4928ed27b79eb9", "new_mode": 33261, "new_path": "t/t5582-fetch-negative-refspec.sh" } ] }