Bug 1639806

Summary: pass incompatible with version of git
Product: [Fedora] Fedora EPEL Reporter: Ricardo Silva <ricardo.silva>
Component: passAssignee: Christophe Fergeau <cfergeau>
Status: CLOSED CANTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: epel7CC: carl, cfergeau, dabe, danny, erik.hedl, kent, o.freyermuth, pasteur, pingou, vascom2, wienemann, yferszt
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-21 16:44:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1760988    
Attachments:
Description Flags
Fix EPEL7 Incompatibility none

Description Ricardo Silva 2018-10-16 15:50:38 UTC
Description of problem:
The latest version of 'pass' uses the '-C' git option which is not available in the git version available on CentOS 7.

Version-Release number of selected component (if applicable):
pass-1.7.3-1.el7.noarch 
git-1.8.3.1-14.el7_5.x86_64

How reproducible:
Every time.

Steps to Reproduce:
1. Not have a $HOME/.password-store
2. Run `pass git init` (to initialize the .password store as a git repo)

Really any `pass git <...>` command fails with the same error

Actual results:
Unknown option: -C
usage: git [--version] [--help] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

Expected results:
Initialized empty Git repository in ...

Additional info:
For other commands sometimes the following error is displayed:
"Error: the password store is not a git repository. Try "pass git init"."
But the underlying error is the same.

pass uses '-C' since ~1.7 was released, I guess the previous version in EPEL was a ~1.6.x

Comment 1 Ricardo Silva 2018-10-16 15:59:02 UTC
After building a newer git, I found pass is also incompatible with the version of tree available on CentOS7. `tree` is used for the `pass find ...` subcommand.

$ tree --version
tree v1.6.0 (...)
$ pass find shops
Search Terms: shops
tree: Invalid argument -`-'.

I can submit a separate bug for this, but it really seems the 1.7.x releases of pass are ahead of their time in the CentOS/EPEL7 environment.

Comment 2 Danny Smith 2018-11-26 10:52:09 UTC
I had the same issue(s). For use at a client site I updated the EPEL pass RPM to require at least the versions of tree and git specified in passwordstore.org's requirements list, and built newer versions of both git at tree to satisfy those dependencies.

Git version required is at least 1.8.5 (I built the last 1.8.5 release, 1.8.5.6).
Tree version required is at least 1.7.0.

Comment 3 Erik Hedl 2018-12-07 23:46:40 UTC
I am running RHEL 7.6. It has git 1.8.3.1, just short of what's needed. Would be great if this would be fixed soon.

Comment 4 Carl George 2018-12-17 19:20:31 UTC
Christophe, how do you want to handle this?  I can think of two possible options.

1. create a patch to make pass compatible with the versions of git and tree shipped in RHEL 7
2. downgrade to a compatible version of pass and add an epoch

Comment 5 Christophe Fergeau 2018-12-18 08:30:11 UTC
1. would be preferrable, but pingou is supposed to be the maintainer for the epel7 branch of pass ;)

Comment 6 Carl George 2019-01-02 19:14:05 UTC
That may be the case, but you're the one that submitted the incompatible update.

https://bodhi.fedoraproject.org/updates/?packages=pass&release=epel-7

Please take care of this, either yourself or by coordinating with pingou.

Comment 7 Christophe Fergeau 2019-01-03 09:07:53 UTC
My guess would be that someone asked me if I could push to epel7 as well /o\

Comment 8 Oliver Freyermuth 2019-03-19 23:30:33 UTC
This seems to be rather stalled for months now, and pass stays unusable. 
Maybe even though the downgrade is not the best solution, it is the only possibility if nobody feels responsible?

Comment 9 Christophe Fergeau 2019-03-20 10:32:44 UTC
The needed functionality is tree --ignore-case --matchdirs. Maybe we can emulate this (suboptimally) with tree -f |sed -i  's,${PREFIX},,' | grep -i ?
Alternatively, we could try building a private copy of an up to date tree as part of pass.spec, and install it in /usr/libexec/password-store/ ?

Comment 10 Christophe Fergeau 2019-03-20 10:33:06 UTC
And I forgot to ask if someone would be up for providing a patch for this? :)

Comment 11 Oliver Freyermuth 2019-04-15 09:57:21 UTC
(In reply to Christophe Fergeau from comment #9)
> The needed functionality is tree --ignore-case --matchdirs. Maybe we can
> emulate this (suboptimally) with tree -f |sed -i  's,${PREFIX},,' | grep -i ?
> Alternatively, we could try building a private copy of an up to date tree as
> part of pass.spec, and install it in /usr/libexec/password-store/ ?

There are also missing parts of Git functionality as outlined in comment #2, so that would be a non-trivial patch...

Comment 12 Carl George 2019-04-22 12:30:53 UTC
Christophe, this has been broken for 7 months now.  Have you tried to contact pingou yet, other than the needsinfo flag?  Alternatively, have you considered contacting upstream and asking them to restore compatibility with git 1.8.3.1 and tree 1.6.0?

If you can't get this sorted out I'm just going to retire the epel7 branch.  There is no sense in shipping a broken package.

Comment 14 Christophe Fergeau 2019-05-13 09:19:13 UTC
(In reply to Carl George from comment #12)
> Christophe, this has been broken for 7 months now.  Have you tried to
> contact pingou yet, other than the needsinfo flag?  Alternatively, have you
> considered contacting upstream and asking them to restore compatibility with
> git 1.8.3.1 and tree 1.6.0?
> 
> If you can't get this sorted out I'm just going to retire the epel7 branch. 
> There is no sense in shipping a broken package.

Feel free to go ahead with either of these solutions. Downgrading with an epoch would be another option, but some security patches would need to be backported iirc...

Comment 15 Pierre-YvesChibon 2019-05-13 09:33:43 UTC
> Have you tried to contact pingou yet, other than the needsinfo flag? 

FTR, yes we've been in touched.
The issue is that both of us worked on pass in EPEL7 because we were asked by others but neither of us is using it there.

I am entirely fine with retiring it, unless someone wants to invest time and efforts into either solutions described here.

Comment 16 Peter Wienemann 2019-05-13 09:42:05 UTC
(In reply to Christophe Fergeau from comment #14) 
> Feel free to go ahead with either of these solutions. Downgrading with an
> epoch would be another option, but some security patches would need to be
> backported iirc...

For what it's worth, I think downgrading is the lesser evil from a user's point of view.

Comment 17 Carl George 2019-05-21 16:44:22 UTC
I retired the epel7 branch.

https://src.fedoraproject.org/rpms/pass/c/e86cf0da924d1023acdc937d335c7533434751dc

Comment 18 Carl George 2019-05-28 19:09:02 UTC
If anyone picks this back up again in the future, and thinks it will be simple to just revert to pass 1.5 with an epoch, be aware that version if vulnerable to CVE-2018-12356 (bug 1591572).

Comment 19 Vasiliy Glazov 2019-10-16 10:45:38 UTC
May be add this again with forbidden "pass git init" feature?

Because of that qtpass can't be installed from epel7 https://bugzilla.redhat.com/show_bug.cgi?id=1760988

Comment 20 Vasiliy Glazov 2019-10-16 13:33:12 UTC
I am asked upstream and they give this solution
https://lists.zx2c4.com/pipermail/password-store/2019-October/003791.html

sed 's/git -C/xgit/'

then add this function:

xgit() {
	cd "$1" || return 1
	shift
	git "$@"
}

Comment 21 Carl George 2019-10-16 15:08:16 UTC
If anyone wants to help sort this out for the epel7 branch, feel free to send a pull request to the pass master branch to make it compatible.

https://src.fedoraproject.org/rpms/pass/tree/master

Once the master branch builds successfully for EL7, I'd be happy to unretire the epel7 branch and merge master back to it.  But be aware, the current version of pass is incompatible with both EL7's git and tree versions.  We'll need patches to fix both issues.

Comment 22 Dabe Murphy 2021-05-19 00:22:48 UTC
Created attachment 1784645 [details]
Fix EPEL7 Incompatibility

"git format-patch" email to support `git v1.8.3.1` and `tree v1.6.0`

Comment 23 Dabe Murphy 2021-05-19 00:27:27 UTC
(In reply to Carl George from comment #21)
> If anyone wants to help sort this out for the epel7 branch, feel free to
> send a pull request to the pass master branch to make it compatible.
> 
> https://src.fedoraproject.org/rpms/pass/tree/master
> 
> Once the master branch builds successfully for EL7, I'd be happy to unretire
> the epel7 branch and merge master back to it.  But be aware, the current
> version of pass is incompatible with both EL7's git and tree versions. 
> We'll need patches to fix both issues.

I tried submitting a PR, but between not being able to agree to the Fedora Project Contributor Agreement ("FAS2 is deprecated") and not being able to find `pass` in the list of projects, I gave up...

So I've attached a "git format-patch" email version.  Maybe that will help?  «crossing fingers»

PS — It's a shame it took two-and-a-half years (and the likes of somebody like *ME!*) to get this fixed; it was really only ~4 lines of code for each incompatibility.

Thanks!