Skip to content

Commit 0e7afb1

Browse files
pahgitster
authored andcommitted
contrib: add credential helper for GnomeKeyring
With this installed in your $PATH, you can store git-over-http passwords in your keyring by doing: git config credential.helper gnome-keyring The code is based in large part on the work of John Szakmeister who wrote the helper originally for the initial, unpublished version of the credential helper protocol. This version will pass t0303 if you do: GIT_TEST_CREDENTIAL_HELPER=gnome-keyring \ ./t0303-credential-external.sh Signed-off-by: Philipp A. Hartmann <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 889d358 commit 0e7afb1

File tree

3 files changed

+470
-0
lines changed

3 files changed

+470
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
git-credential-gnome-keyring
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
MAIN:=git-credential-gnome-keyring
2+
all:: $(MAIN)
3+
4+
CC = gcc
5+
RM = rm -f
6+
CFLAGS = -g -O2 -Wall
7+
8+
-include ../../../config.mak.autogen
9+
-include ../../../config.mak
10+
11+
INCS:=$(shell pkg-config --cflags gnome-keyring-1)
12+
LIBS:=$(shell pkg-config --libs gnome-keyring-1)
13+
14+
SRCS:=$(MAIN).c
15+
OBJS:=$(SRCS:.c=.o)
16+
17+
%.o: %.c
18+
$(CC) $(CFLAGS) $(CPPFLAGS) $(INCS) -o $@ -c $<
19+
20+
$(MAIN): $(OBJS)
21+
$(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
22+
23+
clean:
24+
@$(RM) $(MAIN) $(OBJS)

0 commit comments

Comments
 (0)