Skip to content

Commit 4cb51a6

Browse files
committed
Sync with 1.6.5.6
Signed-off-by: Junio C Hamano <[email protected]>
2 parents 80d9361 + 9861b64 commit 4cb51a6

File tree

7 files changed

+37
-179
lines changed

7 files changed

+37
-179
lines changed

Documentation/RelNotes-1.6.5.6.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Git v1.6.5.6 Release Notes
2+
==========================
3+
4+
Fixes since v1.6.5.5
5+
--------------------
6+
7+
* "git add -p" had a regression since v1.6.5.3 that broke deletion of
8+
non-empty files.
9+
10+
* "git archive -o o.zip -- Makefile" produced an archive in o.zip
11+
but in POSIX tar format.
12+
13+
* Error message given to "git pull --rebase" when the user didn't give
14+
enough clue as to what branch to integrate with still talked about
15+
"merging with" the branch.
16+
17+
* Error messages given by "git merge" when the merge resulted in a
18+
fast-forward still were in plumbing lingo, even though in v1.6.5
19+
we reworded messages in other cases.
20+
21+
* The post-upload-hook run by upload-pack in response to "git fetch" has
22+
been removed, due to security concerns (the hook first appeared in
23+
1.6.5).

Documentation/git-upload-pack.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ The UI for the protocol is on the 'git-fetch-pack' side, and the
2020
program pair is meant to be used to pull updates from a remote
2121
repository. For push operations, see 'git-send-pack'.
2222

23-
After finishing the operation successfully, `post-upload-pack`
24-
hook is called (see linkgit:githooks[5]).
2523

2624
OPTIONS
2725
-------

Documentation/git.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ unreleased) version of git, that is available from 'master'
4343
branch of the `git.git` repository.
4444
Documentation for older releases are available here:
4545

46-
* link:v1.6.5.5/git.html[documentation for release 1.6.5.5]
46+
* link:v1.6.5.6/git.html[documentation for release 1.6.5.6]
4747

4848
* release notes for
49+
link:RelNotes-1.6.5.6.txt[1.6.5.6],
4950
link:RelNotes-1.6.5.5.txt[1.6.5.5],
5051
link:RelNotes-1.6.5.4.txt[1.6.5.4],
5152
link:RelNotes-1.6.5.3.txt[1.6.5.3],

Documentation/githooks.txt

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -310,35 +310,6 @@ Both standard output and standard error output are forwarded to
310310
'git-send-pack' on the other end, so you can simply `echo` messages
311311
for the user.
312312

313-
post-upload-pack
314-
----------------
315-
316-
After upload-pack successfully finishes its operation, this hook is called
317-
for logging purposes.
318-
319-
The hook is passed various pieces of information, one per line, from its
320-
standard input. Currently the following items can be fed to the hook, but
321-
more types of information may be added in the future:
322-
323-
want SHA-1::
324-
40-byte hexadecimal object name the client asked to include in the
325-
resulting pack. Can occur one or more times in the input.
326-
327-
have SHA-1::
328-
40-byte hexadecimal object name the client asked to exclude from
329-
the resulting pack, claiming to have them already. Can occur zero
330-
or more times in the input.
331-
332-
time float::
333-
Number of seconds spent for creating the packfile.
334-
335-
size decimal::
336-
Size of the resulting packfile in bytes.
337-
338-
kind string:
339-
Either "clone" (when the client did not give us any "have", and asked
340-
for all our refs with "want"), or "fetch" (otherwise).
341-
342313
pre-auto-gc
343314
~~~~~~~~~~~
344315

builtin-archive.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,17 @@ int cmd_archive(int argc, const char **argv, const char *prefix)
106106
if (format) {
107107
sprintf(fmt_opt, "--format=%s", format);
108108
/*
109-
* This is safe because either --format and/or --output must
110-
* have been given on the original command line if we get to
111-
* this point, and parse_options() must have eaten at least
112-
* one argument, i.e. we have enough room to append to argv[].
109+
* We have enough room in argv[] to muck it in place,
110+
* because either --format and/or --output must have
111+
* been given on the original command line if we get
112+
* to this point, and parse_options() must have eaten
113+
* it, i.e. we can add back one element to the array.
114+
* But argv[] may contain "--"; we should make it the
115+
* first option.
113116
*/
114-
argv[argc++] = fmt_opt;
115-
argv[argc] = NULL;
117+
memmove(argv + 2, argv + 1, sizeof(*argv) * argc);
118+
argv[1] = fmt_opt;
119+
argv[++argc] = NULL;
116120
}
117121

118122
if (remote)

t/t5501-post-upload-pack.sh

Lines changed: 0 additions & 69 deletions
This file was deleted.

upload-pack.c

Lines changed: 2 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -148,79 +148,19 @@ static int do_rev_list(int fd, void *create_full_pack)
148148
return 0;
149149
}
150150

151-
static int feed_msg_to_hook(int fd, const char *fmt, ...)
152-
{
153-
int cnt;
154-
char buf[1024];
155-
va_list params;
156-
157-
va_start(params, fmt);
158-
cnt = vsprintf(buf, fmt, params);
159-
va_end(params);
160-
return write_in_full(fd, buf, cnt) != cnt;
161-
}
162-
163-
static int feed_obj_to_hook(const char *label, struct object_array *oa, int i, int fd)
164-
{
165-
return feed_msg_to_hook(fd, "%s %s\n", label,
166-
sha1_to_hex(oa->objects[i].item->sha1));
167-
}
168-
169-
static int run_post_upload_pack_hook(size_t total, struct timeval *tv)
170-
{
171-
const char *argv[2];
172-
struct child_process proc;
173-
int err, i;
174-
175-
argv[0] = "hooks/post-upload-pack";
176-
argv[1] = NULL;
177-
178-
if (access(argv[0], X_OK) < 0)
179-
return 0;
180-
181-
memset(&proc, 0, sizeof(proc));
182-
proc.argv = argv;
183-
proc.in = -1;
184-
proc.stdout_to_stderr = 1;
185-
err = start_command(&proc);
186-
if (err)
187-
return err;
188-
for (i = 0; !err && i < want_obj.nr; i++)
189-
err |= feed_obj_to_hook("want", &want_obj, i, proc.in);
190-
for (i = 0; !err && i < have_obj.nr; i++)
191-
err |= feed_obj_to_hook("have", &have_obj, i, proc.in);
192-
if (!err)
193-
err |= feed_msg_to_hook(proc.in, "time %ld.%06ld\n",
194-
(long)tv->tv_sec, (long)tv->tv_usec);
195-
if (!err)
196-
err |= feed_msg_to_hook(proc.in, "size %ld\n", (long)total);
197-
if (!err)
198-
err |= feed_msg_to_hook(proc.in, "kind %s\n",
199-
(nr_our_refs == want_obj.nr && !have_obj.nr)
200-
? "clone" : "fetch");
201-
if (close(proc.in))
202-
err = 1;
203-
if (finish_command(&proc))
204-
err = 1;
205-
return err;
206-
}
207-
208151
static void create_pack_file(void)
209152
{
210-
struct timeval start_tv, tv;
211153
struct async rev_list;
212154
struct child_process pack_objects;
213155
int create_full_pack = (nr_our_refs == want_obj.nr && !have_obj.nr);
214156
char data[8193], progress[128];
215157
char abort_msg[] = "aborting due to possible repository "
216158
"corruption on the remote side.";
217159
int buffered = -1;
218-
ssize_t sz, total_sz;
160+
ssize_t sz;
219161
const char *argv[10];
220162
int arg = 0;
221163

222-
gettimeofday(&start_tv, NULL);
223-
total_sz = 0;
224164
if (shallow_nr) {
225165
rev_list.proc = do_rev_list;
226166
rev_list.data = 0;
@@ -346,7 +286,7 @@ static void create_pack_file(void)
346286
sz = xread(pack_objects.out, cp,
347287
sizeof(data) - outsz);
348288
if (0 < sz)
349-
total_sz += sz;
289+
;
350290
else if (sz == 0) {
351291
close(pack_objects.out);
352292
pack_objects.out = -1;
@@ -383,16 +323,6 @@ static void create_pack_file(void)
383323
}
384324
if (use_sideband)
385325
packet_flush(1);
386-
387-
gettimeofday(&tv, NULL);
388-
tv.tv_sec -= start_tv.tv_sec;
389-
if (tv.tv_usec < start_tv.tv_usec) {
390-
tv.tv_sec--;
391-
tv.tv_usec += 1000000;
392-
}
393-
tv.tv_usec -= start_tv.tv_usec;
394-
if (run_post_upload_pack_hook(total_sz, &tv))
395-
warning("post-upload-hook failed");
396326
return;
397327

398328
fail:

0 commit comments

Comments
 (0)