Skip to content

git-credential-netrc: accept gpg.program option through git-config and command argument - #490

Closed
lmmarsano wants to merge 2 commits into
git:masterfrom
lmmarsano:netrc-option
Closed

lmmarsano wants to merge 2 commits into
git:masterfrom
lmmarsano:netrc-option

Conversation

@lmmarsano

@lmmarsano lmmarsano commented May 9, 2018 •

Copy link
Copy Markdown
Contributor

Hi everyone,

How do I submit these contrib/ area patches?
Contributed Software page says to forward them (acknowledged by the component's author) to "jc" (I'm guessing that's Junio), but I think they're getting missed.
Though the component author says they're okay, do they need more work before I resubmit?
Thanks.

git-credential-netrc was hardcoded to call 'gpg' for decryption.
This is a problem on distributions like Debian that call modern GnuPG something else, like 'gpg2'.
This proposed update reuses git's gpg.program configuration to customize GnuPG's name.
It introduces the -g|--gpg option on the git-credential-netrc command to allow alternatively setting it in git's credential.helper configuration.
Since testing a git configuration involves a temporary repository as provided by git's main testing framework, a patch updating tests to reuse the main framework is included, too.

------- Forwarded message
That looks terrific, Luis. It's a good change so I'd just go ahead and
propose those patches. I don't see anything incorrect and tests are always
good.

Ted

On Thu, Apr 19, 2018 at 1:48 PM, Luis Marsano [email protected]
wrote:

Hello Ted Zlatanov,

Thank you for git-credential-netrc.
Will you please look over these patches and decide if they need more work?
They're also available as the netrc-option branch at
https://github.com/lmmarsano/git
This is a first contribution for me, and I welcome input, suggestions,
criticisms, corrections.
Thanks.

git-credential-netrc was hardcoded to call 'gpg' for decryption.
This is a problem on distributions like Debian that call modern GnuPG
something else, like 'gpg2'.
This proposed update reuses git's gpg.program configuration to customize
GnuPG's name.
It introduces the -g|--gpg option on the git-credential-netrc command to
allow alternatively setting it in git's credential.helper configuration.
Since testing a git configuration involves a temporary repository as
provided by git's main testing framework, a patch updating tests to reuse
the main framework is included, too.

Luis Marsano (2):
git-credential-netrc: adapt to test framework for git
git-credential-netrc: accept gpg option

contrib/credential/netrc/Makefile | 4 +-
contrib/credential/netrc/git-credential-netrc | 69 +++++++++++------
contrib/credential/netrc/t-git-credential-netrc.sh | 31 ++++++++
contrib/credential/netrc/test.command-option-gpg | 2 +
contrib/credential/netrc/test.git-config-gpg | 2 +
contrib/credential/netrc/test.netrc.gpg | 0
contrib/credential/netrc/test.pl | 86
+++++++++++++++-------
7 files changed, 142 insertions(+), 52 deletions(-)
create mode 100755 contrib/credential/netrc/t-git-credential-netrc.sh
create mode 100755 contrib/credential/netrc/test.command-option-gpg
create mode 100755 contrib/credential/netrc/test.git-config-gpg
create mode 100644 contrib/credential/netrc/test.netrc.gpg

--
2.7.4

------- End of Forwarded message

lmmarsano added 2 commits May 9, 2018 12:03
until this change, git-credential-netrc did not test in a repository
this change reuses the main test framework, which provides such tests
specific changes
- switch to Test::More module
- use File::Basename & File::Spec::Functions

Signed-off-by: Luis Marsano <[email protected]>
git-credential-netrc was hardcoded to decrypt with 'gpg' regardless of the gpg.program option
this now uses the gpg command option if set, else, the gpg.program option set in the git repository or global configuration, else defaults to 'gpg'
for git-credential-netrc
- use Git.pm for repository and global option queries
- add -g|--gpg command option & document it in command usage
- test repository & command options
- support unicode

Signed-off-by: Luis Marsano <[email protected]>
@lmmarsano lmmarsano changed the title PR Title git-credential-netrc: accept gpg.program option through git-config and command argument May 9, 2018
@lmmarsano lmmarsano closed this May 9, 2018
kanokwanmaneeon referenced this pull request Apr 12, 2019
In the contributing guide and PR template seen by people who open pull
requests on GitHub, we mention the submitGit tool, which gives an
alternative to figuring out the mailing list. These days we also have
the similar GitGitGadget tool, and we should make it clear that this
is also an option.

We could continue to mention _both_ tools, but it's probably better to
pick one in order to avoid overwhelming the user with choice. After all,
one of the purposes here is to reduce friction for first-time or
infrequent contributors. And there are a few reasons to prefer GGG:

  1. submitGit seems to still have a few rough edges. E.g., it doesn't
     munge timestamps to help threaded mail readers handled out-of-order
     delivery.

  2. Subjectively, GGG seems to be more commonly used on the list these
     days, especially by list regulars.

  3. GGG seems to be under more active development (likely related to
     point 2).

So let's actually swap out submitGit for GGG. While we're there, let's
put another link to the GGG page in the PR template, because that's
where users who are learning about it for the first time will want to go
to read more.

Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
derrickstolee added a commit to derrickstolee/git that referenced this pull request May 22, 2022
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Jun 23, 2022
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Jun 27, 2022
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Jul 14, 2022
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Sep 30, 2022
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Oct 4, 2022
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Nov 8, 2022
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Mar 15, 2023
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Mar 15, 2023
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request May 11, 2023
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Aug 23, 2023
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
vdye pushed a commit to vdye/git that referenced this pull request Jan 9, 2024
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
vdye pushed a commit to vdye/git that referenced this pull request Jan 9, 2024
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
vdye pushed a commit to vdye/git that referenced this pull request Jan 9, 2024
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Apr 30, 2024
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request May 10, 2024
This should fix git#490, at least in the case that I've been able to
verify.

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee added a commit to derrickstolee/git that referenced this pull request May 10, 2024
This should fix git#490, at least in the case that I've been able to
verify.

The issue is that reset was setting the skip-worktree bit more
frequently than it should have. The previous fix in git#494 was focused on
the case where a file is added or removed across the diff. However, when
the file exists on both sides but still needs to be staged in a mixed
reset then we should avoid the skip-worktree bit.

Signed-off-by: Derrick Stolee <[email protected]>
derrickstolee added a commit to derrickstolee/git that referenced this pull request May 31, 2024
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Jun 19, 2024
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Jul 19, 2024
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Aug 23, 2024
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Sep 30, 2024
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Oct 9, 2024
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
dscho pushed a commit to derrickstolee/git that referenced this pull request Dec 10, 2024
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Aug 5, 2025
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Sep 2, 2025
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Nov 7, 2025
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Feb 3, 2026
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Apr 22, 2026
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
derrickstolee added a commit to derrickstolee/git that referenced this pull request Oct 13, 2026
… filesystem

This replaces git#493 (can't reopen a PR after a force-push...).

I updated this commit with a more firm version of the fix. This hopefully answers Victoria's excellent concerns with the previous approach.

I did not manage to get an automated test for this, but I did carefully verify this manually with a few commits in a VFS for Git enlistment (with different files every time). I updated the commit message with more details about why this works.

---

This fork contains changes specific to monorepo scenarios. If you are an
external contributor, then please detail your reason for submitting to
this fork:

* [X] This change only applies to the virtualization hook and VFS for Git.

Resolves git#490.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant