Allow helpers to report in "list" command that the ref is unchanged
[git/git.git] / Documentation / git-remote-helpers.txt
1 git-remote-helpers(1)
2 =====================
3
4 NAME
5 ----
6 git-remote-helpers - Helper programs for interoperation with remote git
7
8 SYNOPSIS
9 --------
10 'git remote-<transport>' <remote>
11
12 DESCRIPTION
13 -----------
14
15 These programs are normally not used directly by end users, but are
16 invoked by various git programs that interact with remote repositories
17 when the repository they would operate on will be accessed using
18 transport code not linked into the main git binary. Various particular
19 helper programs will behave as documented here.
20
21 COMMANDS
22 --------
23
24 Commands are given by the caller on the helper's standard input, one per line.
25
26 'capabilities'::
27 Lists the capabilities of the helper, one per line, ending
28 with a blank line.
29
30 'list'::
31 Lists the refs, one per line, in the format "<value> <name>
32 [<attr> ...]". The value may be a hex sha1 hash, "@<dest>" for
33 a symref, or "?" to indicate that the helper could not get the
34 value of the ref. A space-separated list of attributes follows
35 the name; unrecognized attributes are ignored. After the
36 complete list, outputs a blank line.
37
38 'fetch' <sha1> <name>::
39 Fetches the given object, writing the necessary objects to the
40 database. Outputs a blank line when the fetch is
41 complete. Only objects which were reported in the ref list
42 with a sha1 may be fetched this way.
43 +
44 Supported if the helper has the "fetch" capability.
45
46 'import' <name>::
47 Produces a fast-import stream which imports the current value
48 of the named ref. It may additionally import other refs as
49 needed to construct the history efficiently. The script writes
50 to a helper-specific private namespace. The value of the named
51 ref should be written to a location in this namespace derived
52 by applying the refspecs from the "refspec" capability to the
53 name of the ref.
54 +
55 Supported if the helper has the "import" capability.
56
57 If a fatal error occurs, the program writes the error message to
58 stderr and exits. The caller should expect that a suitable error
59 message has been printed if the child closes the connection without
60 completing a valid response for the current command.
61
62 Additional commands may be supported, as may be determined from
63 capabilities reported by the helper.
64
65 CAPABILITIES
66 ------------
67
68 'fetch'::
69 This helper supports the 'fetch' command.
70
71 'import'::
72 This helper supports the 'import' command.
73
74 'refspec' 'spec'::
75 When using the import command, expect the source ref to have
76 been written to the destination ref. The earliest applicable
77 refspec takes precedence. For example
78 "refs/heads/*:refs/svn/origin/branches/*" means that, after an
79 "import refs/heads/name", the script has written to
80 refs/svn/origin/branches/name. If this capability is used at
81 all, it must cover all refs reported by the list command; if
82 it is not used, it is effectively "*:*"
83
84 REF LIST ATTRIBUTES
85 -------------------
86
87 'unchanged'::
88 This ref is unchanged since the last import or fetch, although
89 the helper cannot necessarily determine what value that produced.
90
91 Documentation
92 -------------
93 Documentation by Daniel Barkalow.
94
95 GIT
96 ---
97 Part of the linkgit:git[1] suite