cms-sw / cms-git-tools

CMS Git Helpers
34 stars 26 forks source link

check if topic branch is behind release when using checkout-topic #89

Closed kpedro88 closed 7 years ago

kpedro88 commented 7 years ago

Requested by @makortel. Tested w/ CMSSW_10_0_X_2017-11-14-2300 and git cms-checkout-topic 20879, in this case, it prints:

Warning: pull/20879 is behind from-CMSSW_10_0_X_2017-11-14-2300. You may not be able to compile or run.

If instead using CMSSW_10_0_X_2017-11-14-1100, no message is printed (as expected).

The message is printed after checkdeps, so the user doesn't miss the message in case checkdeps has a long list.

cmsbuild commented 7 years ago

A new Pull Request was created by @kpedro88 (Kevin Pedro) for branch master.

@cmsbuild, @smuzaffar, @gudrutis, @mrodozov can you please review it and eventually sign? Thanks. You can sign-off by replying to this message having '+1' in the first line of your reply. You can reject by replying to this message having '-1' in the first line of your reply.

external issue cms-sw/cmsdist#3576

fwyzard commented 7 years ago

I'm confused.

Shouldn't there be a warning also if the "topic" is based on a newer IB than the developer's area, as it my bring in some (or a lot of) unrelated changes ?

kpedro88 commented 7 years ago

It will bring in unrelated changes, but after bringing in those changes, it will be able to compile.

It's not nearly as straightforward to disambiguate "ahead because of new commits from developer" vs "ahead because based on a new IB". Given the intended uses of cms-checkout-topic, it doesn't seem as important to me.

fwyzard commented 7 years ago

Given the intended uses of cms-checkout-topic, it doesn't seem as important to me.

I'm sure you know better what is useful for most other users.

Personally I don't mind, since I don't see any practical use for cms-checkout-topic (I'd rather checkout some topic in a local branch without changing my working area, and not leave cms-sw/refs/pull/#####/head and pull/#####_backup around).

kpedro88 commented 7 years ago

If a lot of people start using cms-checkout-topic for some off-label purpose and encounter problems, then we can consider motivated changes to it. So far, I haven't observed that.

I almost never use any cms-...-topic tool with a PR number. The intended purpose of cms-checkout-topic is to remake a working area (e.g. if the developer accidentally deletes it, or changes computers, or sparse checkout has an issue, etc.). Having addpkg based on the merge-base of the branch and release is a useful feature.

I do think it would be nice to have some tool that automatically finds out the "official" base of a branch, but it's a circular problem - you need a local .git area initialized to know the tags/labels of the commits.