Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
git_borg_linker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LBMC
Hub
git_borg_linker
Commits
e6b932ee
Commit
e6b932ee
authored
Sep 2, 2022
by
nfontrod
Browse files
Options
Downloads
Patches
Plain Diff
src/main.rs: add last and diff option to mount subcommand
parent
e88d7623
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.rs
+31
-8
31 additions, 8 deletions
src/main.rs
with
31 additions
and
8 deletions
src/main.rs
+
31
−
8
View file @
e6b932ee
...
@@ -52,7 +52,8 @@ enum Commands {
...
@@ -52,7 +52,8 @@ enum Commands {
DeleteHooks
,
DeleteHooks
,
/// Show differences between two commits of the `results` folder
/// Show differences between two commits of the `results` folder
Diff
(
Diff
),
Diff
(
Diff
),
/// Mount an old file/directory from one or multiple commits into the .mount folder inside de project directory.
/// Mount an old file/directory from one or multiple archive named afert
/// git commits into the .mount folder inside de project directory.
Mount
(
Mount
),
Mount
(
Mount
),
/// Unmount everything in the folder .mount
/// Unmount everything in the folder .mount
Umount
,
Umount
,
...
@@ -143,20 +144,36 @@ struct Diff {
...
@@ -143,20 +144,36 @@ struct Diff {
#[derive(Debug,
Args)]
#[derive(Debug,
Args)]
struct
Mount
{
struct
Mount
{
/// Commit name, sh: Glob is supported.
/// Commit name, sh: Glob is supported.
This is an optional parameter: if
///
This is an optional parameter: if
not set then all commits will be
displayed
/// not set then all commit
archive
s will be
mounted into the .mount directory
#[clap(short,
long)]
#[clap(short,
long)]
commit
:
Option
<
String
>
,
commit
:
Option
<
String
>
,
/// The file/directory to extract
/// The file/directory to extract
. This is an optional parameter. If not set
///
This is an optional parameter. If not set
then all files in the archive will be displayed
/// then all files in the archive will be displayed
#[clap(short,
long)]
#[clap(short,
long)]
path
:
Option
<
String
>
,
path
:
Option
<
String
>
,
/// If set, displays the .mount directory in 'version view'.
/// If set, displays the .mount directory in 'version view'.
///
///
/// - Normal view: The mount directory contains a subfolder with the name of archives
/// - Normal view: The `.mount` directory contains a subfolder with the name
/// - Version view: The mount directory contains the results folder and every file within it becomes a directory storing every version of that file
/// of archives.
///
/// - Version view: The `.mount` directory contains the results folder and
/// every file within it becomes a directory storing every version of
/// that file
#[clap(short,
long)]
#[clap(short,
long)]
versions
:
bool
,
versions
:
bool
,
/// Displays the differences between two files mounted corresponding to the
/// given path.
///
/// Note that if only one file is recovered then, the other is taken from
/// the current result folder
///
/// This option is deactivated when used with --diff
#[clap(short,
long)]
diff
:
bool
,
/// Consider last N archive after other filter were applied
#[clap(short,
long)]
last
:
Option
<
u8
>
,
}
}
fn
main
()
{
fn
main
()
{
...
@@ -201,7 +218,13 @@ fn main() {
...
@@ -201,7 +218,13 @@ fn main() {
}
}
Commands
::
Mount
(
mount
)
=>
{
Commands
::
Mount
(
mount
)
=>
{
mount
::
umount_archive
(
true
);
mount
::
umount_archive
(
true
);
mount
::
mount_archive
(
&
mount
.commit
,
&
mount
.path
,
mount
.versions
);
mount
::
mount_archive
(
&
mount
.commit
,
&
mount
.path
,
mount
.versions
,
mount
.diff
,
mount
.last
,
);
}
}
Commands
::
Umount
=>
{
Commands
::
Umount
=>
{
mount
::
umount_archive
(
false
);
mount
::
umount_archive
(
false
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment