|
So - I think hashCode() for the URL actually does make sense. It's more or less guaranteed to be unique here - I'd like to use the sha1, but then I have to put in some weird logic to deal with cases where there are multiple remote repos pulling into one local repo and merging and things just get odd.
For the display name (both on the BuildData and GitTagAction), I'm thinking something like this logic:
-
If scmName is defined, use that. Nice and simple.
-
Otherwise, if there's only one remote repository/branch spec combo, use the repo name (i.e., just just the whatever.git, not full URL) and branch spec (everything after the first slash, that is, so the branch name or pattern excluding the remote).
-
Lastly, if there are multiple remote repositories, forget it, we just punt and put a "#1", "#2", whatever there. In cases where there could be multiple BuildData added, it'll be really, really, really rare that there are multiple remote repositories in a single BuildData, I think, so I'm willing to compromise on the aesthetics in those edge cases in order to get a win on the other far more common cases.
Actually, maybe don't bother for GitTagAction and instead change the text to say "Tag the above" or something along those lines, since it's always going to be the next Action after its associated BuildData, which will present more information. And I'm leaning towards rewording "Git Build Data" to something shorter if possible, so that the additional text we'll be throwing on the display text has some room before the word wrapping/line count goes bonkers.
Thoughts?
|