commit - 824d5f776c8195a3faa8c0b167888dbb99542482
commit + 4ad4a1ec452e58730b6d841ae6a044ff53827e15
blob - ca162036c4a7413a130d54e0e6c5d6e375606b33
blob + 562571621fea9038dfaca7cfec630342fde17210
--- got/got.1
+++ got/got.1
.It Cm fe
Short alias for
.Cm fetch .
-.It Cm checkout Oo Fl E Oc Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Oo Fl p Ar path-prefix Oc Ar repository-path Op Ar work-tree-path
+.It Cm checkout Oo Fl E Oc Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Oo Fl p Ar path-prefix Oc Oo Fl q Oc Ar repository-path Op Ar work-tree-path
Copy files from a repository into a new work tree.
Show the status of each affected file, using the following status codes:
.Bl -column YXZ description
Only files beneath the specified
.Ar path-prefix
will be checked out.
+.It Fl q
+Silence progress output.
.El
.It Cm co
Short alias for
.Cm checkout .
-.It Cm update Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Op Ar path ...
+.It Cm update Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Oo Fl q Oc Op Ar path ...
Update an existing work tree to a different
.Ar commit .
Change existing files in the work tree as necessary to match file contents
automatically, provided the abbreviation is unique.
If this option is not specified, the most recent commit on the work tree's
branch will be used.
+.It Fl q
+Silence progress output.
.El
.It Cm up
Short alias for
blob - b1b444cf1fc04c7930365cd15df8871bd7a5ee3d
blob + e0fa2127a56f4fd45394cbea92d0f7cbe3ce866f
--- got/got.c
+++ got/got.c
usage_checkout(void)
{
fprintf(stderr, "usage: %s checkout [-E] [-b branch] [-c commit] "
- "[-p prefix] repository-path [worktree-path]\n", getprogname());
+ "[-p prefix] [-q] repository-path [worktree-path]\n",
+ getprogname());
exit(1);
}
struct got_checkout_progress_arg {
const char *worktree_path;
int had_base_commit_ref_error;
+ int verbosity;
};
static const struct got_error *
while (path[0] == '/')
path++;
- printf("%c %s/%s\n", status, a->worktree_path, path);
+ if (a->verbosity >= 0)
+ printf("%c %s/%s\n", status, a->worktree_path, path);
+
return NULL;
}
const char *branch_name = GOT_REF_HEAD;
char *commit_id_str = NULL;
char *cwd = NULL;
- int ch, same_path_prefix, allow_nonempty = 0;
+ int ch, same_path_prefix, allow_nonempty = 0, verbosity = 0;
struct got_pathlist_head paths;
struct got_checkout_progress_arg cpa;
TAILQ_INIT(&paths);
- while ((ch = getopt(argc, argv, "b:c:Ep:")) != -1) {
+ while ((ch = getopt(argc, argv, "b:c:Ep:q")) != -1) {
switch (ch) {
case 'b':
branch_name = optarg;
case 'p':
path_prefix = optarg;
break;
+ case 'q':
+ verbosity = -1;
+ break;
default:
usage_checkout();
/* NOTREACHED */
goto done;
cpa.worktree_path = worktree_path;
cpa.had_base_commit_ref_error = 0;
+ cpa.verbosity = verbosity;
error = got_worktree_checkout_files(worktree, &paths, repo,
checkout_progress, &cpa, check_cancelled, NULL);
if (error != NULL)
int conflicts;
int obstructed;
int not_updated;
+ int verbosity;
};
void
__dead static void
usage_update(void)
{
- fprintf(stderr, "usage: %s update [-b branch] [-c commit] [path ...]\n",
+ fprintf(stderr, "usage: %s update [-b branch] [-c commit] [-q] "
+ "[path ...]\n",
getprogname());
exit(1);
}
while (path[0] == '/')
path++;
- printf("%c %s\n", status, path);
+ if (upa->verbosity >= 0)
+ printf("%c %s\n", status, path);
+
return NULL;
}
struct got_reference *head_ref = NULL;
struct got_pathlist_head paths;
struct got_pathlist_entry *pe;
- int ch;
+ int ch, verbosity = 0;
struct got_update_progress_arg upa;
TAILQ_INIT(&paths);
- while ((ch = getopt(argc, argv, "b:c:")) != -1) {
+ while ((ch = getopt(argc, argv, "b:c:q")) != -1) {
switch (ch) {
case 'b':
branch_name = optarg;
commit_id_str = strdup(optarg);
if (commit_id_str == NULL)
return got_error_from_errno("strdup");
+ break;
+ case 'q':
+ verbosity = -1;
break;
default:
usage_update();
}
memset(&upa, 0, sizeof(upa));
+ upa.verbosity = verbosity;
error = got_worktree_checkout_files(worktree, &paths, repo,
update_progress, &upa, check_cancelled, NULL);
if (error != NULL)