@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add setup check to avoid git version 2.5.0 and below (May 2015)

Summary:
After this change, if you have a deprecated git version,
now you see a related information config warning:

{F276840}

Having said that the git version 1.8.3.1 - that for example
is provided by CentOS 7 - is surely problematic;

Some sources indicate all git versions *before* 2.5.0 as not
able to handle the '--' escape argument. The '--' arg
is used to separate normal git flags from user arguments,
so that they cannot be mistakenly exchanged. Kind of:

git <flags> -- <arguments>

The problem is, Phabricator/Phorge at the moment executes
this kind of git commands when you surf a git repository from
the web interface:

git cat-file -t -- <hash>:<file>

But, if your git version does not support "--", you can
get yourself into unhappy situations since "--" could be
just interpreted as a "wrong value", causing other
considerations and misleading exceptions, such as:

This path was a submodule at <repo>:<hash>

If you have seen the above error while surfing a git repo,
and if you have 2.5.0 or before, and if you are sure that
the mentioned path it's not a submodule, you probably
need a git update.

It is not yet clear whether Phabricator/Phorge should
support the possibility of this lack of support for "--".
In the meanwhile, just update your git on the server.

AFAIK no particular version is required on your clients.

Related information:

- https://unix.stackexchange.com/a/740621/85666
- https://github.com/git/git/commit/b48158ac94cf725834b70b4a5ab7f2d152a741d4

If you disagree, please do not simply ignore the
warning but share your experience in the Task.

Ref T15179

Test Plan:
- open Phorge, you see no warnings since you are
already up to date. Nice.
- Otherwise, you see a nice config message, and you
can ignore it as usual.

Reviewers: O1 Blessed Committers, Cigaryno, avivey

Reviewed By: O1 Blessed Committers, Cigaryno, avivey

Subscribers: avivey, speck, tobiaswiese, Matthew, Cigaryno

Maniphest Tasks: T15179

Differential Revision: https://we.phorge.it/D25089

+11 -1
+11 -1
src/applications/config/check/PhabricatorBinariesSetupCheck.php
··· 104 104 105 105 switch ($vcs['versionControlSystem']) { 106 106 case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: 107 - $bad_versions = array(); 107 + $bad_versions = array( 108 + // We need 2.5.0 to use "git cat-file -t -- <hash>:<file>" 109 + // https://we.phorge.it/T15179 110 + '< 2.5.0' => pht( 111 + 'The minimum supported version of Git on the server is %s, '. 112 + 'which was released in %s. In older versions, the Git server '. 113 + 'may not be able to escape arguments with the "--" operator. '. 114 + 'Note: your users do not require a particular version of Git.', 115 + '2.5.0', 116 + '2015'), 117 + ); 108 118 break; 109 119 case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: 110 120 $bad_versions = array(