emacscollective / borg

Assimilate Emacs packages as Git submodules
https://emacsmirror.net/manual/borg
GNU General Public License v3.0
255 stars 28 forks source link

borg--maybe-absorb-gitdir: Support arbitrary version suffixes #109

Closed c6c7 closed 3 years ago

c6c7 commented 3 years ago

The Git version installed on a workstation I use Emacs on is of the form "2.32.0.272.[commit-hash]-[branch-name]" and causes borg--maybe-absorb-gitdir to report the error "Invalid version syntax: ‘2.32.0.272.[commit-hash]-[branch-name]’".

I noticed the change borg--maybe-absorb-gitdir: Support version suffix on Windows whitelisted a similar suffix and figured I might instead keep as much from the beginning of the version as possible instead.

Apologies for the string-match cruft in this change. It feels like there should be a cleaner way to accomplish what I'm going for, but I'm not aware of it at the moment.

c6c7 commented 3 years ago

Used let* to remove the nested let expressions. This seems more reasonable to me in terms of style.

tarsius commented 3 years ago

Yes. And also you don't actually need to use two different variable names.

Additionally my fixup commit anchors the regexp, removes superfluous backslashes, and switches to and to push a hypothetically possible future error into version< (which I assume would be easier to understand than something about match-string).

c6c7 commented 3 years ago

Thank you for the edits! I went ahead and squashed your change into mine. Please let me know if I should have done something different. I'm not familiar with PR etiquette in this repository.

tarsius commented 3 years ago

Thanks!