Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rush] Git version requirements are a bit high? #3109

Closed
Faithfinder opened this issue Dec 21, 2021 · 6 comments · Fixed by #3177
Closed

[rush] Git version requirements are a bit high? #3109

Faithfinder opened this issue Dec 21, 2021 · 6 comments · Fixed by #3177

Comments

@Faithfinder
Copy link
Contributor

Faithfinder commented Dec 21, 2021

So, I'm working on my company's build pipeline right now, and I've noticed one unfortunate thing - official docker node images, which I think are most likely to be used with rush, all have git version 2.11 installed rather than anything later. After some digging you can also use node:x-buster images which contain git 2.20.
Since rush wants 2.30, I'd need to install it into the image manually, and with images based on Debian rather than Ubuntu it's not a straightforward process (I think I need to build from source? Maybe I'll find a simpler way, but it doesn't google easily).

While I understand that it's not entirely rush's problem, I do wonder if minimal version really needs to be that high?

@chengcyber
Copy link
Contributor

chengcyber commented Dec 24, 2021

Share my changes to Dockerfile, hope it helps

Install git 2.32.0 from source file at Debian8 system

# install git 2.32.0
RUN apt-get purge -y git && apt-get update \
    && apt-get install -y libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev asciidoc xmlto docbook2x \
    && wget https://github.com/git/git/archive/v2.32.0.tar.gz \
    && tar zxvf v2.32.0.tar.gz \
    && cd git-2.32.0 \
    && make configure \
    && ./configure --prefix=/usr \
    && make all \
    && sudo make install

@Faithfinder
Copy link
Contributor Author

Thanks! That helps me indeed, but the question is sorta philosophical.

@chengcyber
Copy link
Contributor

Agreed. Either document or environment compatibility checker should be improved.

@dmichon-msft
Copy link
Contributor

We can probably get away with reverting the dependency on git 2.30 now that we are calling git merge-base manually, we'll just need to remove the --merge-base flag from the git diff-index call and document that the caller is responsible for calling git merge-base first or else they may get undesired behavior.

@Faithfinder
Copy link
Contributor Author

There's also a question of "How far back can we go" - unless it's 2.20, or, even better, 2.11 - not much point in doing it. 2.25 would be no better than 2.30

@matthiasg
Copy link

2.25 is at least in standard apt install git.

Is there documentation somewhere why this change was made and what the merge-base command (when run manually) is protecting from ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants