[Mono-dev] [mono/moon] [2 commits] fd3b2520: Add a checkout-mono target that parses the README and checks out the cor

Raja R Harinath harinath at hurrynot.org
Wed Oct 6 22:57:20 EDT 2010


Hi,

"Rolf Bjarne Kvinge (RKvinge at novell.com)"
<mono-patches at lists.ximian.com> writes:

>    Commit: fd3b252017c82a9921d4a4ccd438a7e23cc4212f
[snip]
> Add a checkout-mono target that parses the README and checks out the correct mono revision
[snip]  
> +checkout-mono:
> +	cd $(MONO_PATH) && git reset --hard `grep 'cd mono .*hard' $(PWD)/README | awk -F' ' '{print $$7}'`

Whoa!  There is so much that feels wrong about this :-)

Firstly, the 'reset --hard' is an absolute no-no for a checkout.
Please use 'git checkout'.  'reset' modifies the branch metadata --
checkout only modifies the working tree.  'reset --hard' is a
too-convenient bludgeon that smashes your branch metadata and working
tree with one misleadingly simple command -- use with care.

Secondly, I don't think you should be using the README file as a bad
substitute for a tag.  Just create a tag, say "for-moon", in the mono
tree, and update the tag whenever necessary.  With this, the rule above,
and the the instructions in the README can be simplified to:

  cd mono/ && git checkout for-moon

(Eventually, when git's submodule support becomes usable, you could go
in for that.)

- Hari



More information about the Mono-devel-list mailing list