Skip to content

Commit 75a7ea2

Browse files
committed
Merge branch 'maint'
* maint: pack-objects: split implications of --all-progress from progress activation instaweb: restart server if already running prune-packed: only show progress when stderr is a tty Conflicts: builtin-pack-objects.c
2 parents 4831060 + 4f36627 commit 75a7ea2

File tree

6 files changed

+26
-6
lines changed

6 files changed

+26
-6
lines changed

Documentation/git-pack-objects.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ git-pack-objects - Create a packed archive of objects
99
SYNOPSIS
1010
--------
1111
[verse]
12-
'git pack-objects' [-q] [--no-reuse-delta] [--delta-base-offset] [--non-empty]
13-
[--local] [--incremental] [--window=N] [--depth=N] [--all-progress]
12+
'git pack-objects' [-q | --progress | --all-progress] [--all-progress-implied]
13+
[--no-reuse-delta] [--delta-base-offset] [--non-empty]
14+
[--local] [--incremental] [--window=N] [--depth=N]
1415
[--revs [--unpacked | --all]*] [--stdout | base-name]
1516
[--keep-true-parents] < object-list
1617

@@ -137,7 +138,7 @@ base-name::
137138

138139
--all-progress::
139140
When --stdout is specified then progress report is
140-
displayed during the object count and deltification phases
141+
displayed during the object count and compression phases
141142
but inhibited during the write-out phase. The reason is
142143
that in some cases the output stream is directly linked
143144
to another command which may wish to display progress
@@ -146,6 +147,11 @@ base-name::
146147
report for the write-out phase as well even if --stdout is
147148
used.
148149

150+
--all-progress-implied::
151+
This is used to imply --all-progress whenever progress display
152+
is activated. Unlike --all-progress this flag doesn't actually
153+
force any progress display by itself.
154+
149155
-q::
150156
This flag makes the command not to report its progress
151157
on the standard error stream.

builtin-pack-objects.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
static const char pack_usage[] =
2626
"git pack-objects [{ -q | --progress | --all-progress }]\n"
27+
" [--all-progress-implied]\n"
2728
" [--max-pack-size=N] [--local] [--incremental]\n"
2829
" [--window=N] [--window-memory=N] [--depth=N]\n"
2930
" [--no-reuse-delta] [--no-reuse-object] [--delta-base-offset]\n"
@@ -2124,6 +2125,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
21242125
{
21252126
int use_internal_rev_list = 0;
21262127
int thin = 0;
2128+
int all_progress_implied = 0;
21272129
uint32_t i;
21282130
const char **rp_av;
21292131
int rp_ac_alloc = 64;
@@ -2223,6 +2225,10 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
22232225
progress = 2;
22242226
continue;
22252227
}
2228+
if (!strcmp("--all-progress-implied", arg)) {
2229+
all_progress_implied = 1;
2230+
continue;
2231+
}
22262232
if (!strcmp("-q", arg)) {
22272233
progress = 0;
22282234
continue;
@@ -2326,6 +2332,9 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
23262332
if (keep_unreachable && unpack_unreachable)
23272333
die("--keep-unreachable and --unpack-unreachable are incompatible.");
23282334

2335+
if (progress && all_progress_implied)
2336+
progress = 2;
2337+
23292338
prepare_packed_git();
23302339

23312340
if (progress)

builtin-prune-packed.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void prune_packed_objects(int opts)
7171

7272
int cmd_prune_packed(int argc, const char **argv, const char *prefix)
7373
{
74-
int opts = VERBOSE;
74+
int opts = isatty(2) ? VERBOSE : 0;
7575
const struct option prune_packed_options[] = {
7676
OPT_BIT('n', "dry-run", &opts, "dry run", DRY_RUN),
7777
OPT_NEGBIT('q', "quiet", &opts, "be quiet", VERBOSE),

builtin-send-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static int pack_objects(int fd, struct ref *refs, struct extra_have_objects *ext
4040
*/
4141
const char *argv[] = {
4242
"pack-objects",
43-
"--all-progress",
43+
"--all-progress-implied",
4444
"--revs",
4545
"--stdout",
4646
NULL,

bundle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ int create_bundle(struct bundle_header *header, const char *path,
351351

352352
/* write pack */
353353
argv_pack[0] = "pack-objects";
354-
argv_pack[1] = "--all-progress";
354+
argv_pack[1] = "--all-progress-implied";
355355
argv_pack[2] = "--stdout";
356356
argv_pack[3] = "--thin";
357357
argv_pack[4] = NULL;

git-instaweb.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ resolve_full_httpd () {
7373
}
7474

7575
start_httpd () {
76+
if test -f "$fqgitdir/pid"; then
77+
say "Instance already running. Restarting..."
78+
stop_httpd
79+
fi
80+
7681
# here $httpd should have a meaningful value
7782
resolve_full_httpd
7883

0 commit comments

Comments
 (0)