I created a separate JIRA since
HIVE-493 is about automatically inferring partitions during query time and not updating metadata at all. I would like to keep that open since this may not be sufficient for some usecases. Could you upload your patch here?
As for unit tests, check hive/ql/src/test/queries/clientpositive directory that contains the CLI tests. One of the tests could be to create hdfs directories for a table like 'srcpart' and run 'msck repair' on it and do a 'show partitions' on the table again to see if the partition is listed. We need to have some unit tests so that this functionality will not be broken accidentally by some other check-in.