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
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
2 years ago
by
nfontrod
Browse files
Options
Downloads
Patches
Plain Diff
src/main.rs: add last and diff option to mount subcommand
parent
e88d7623
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide 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 {
DeleteHooks
,
/// Show differences between two commits of the `results` folder
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
),
/// Unmount everything in the folder .mount
Umount
,
...
...
@@ -143,20 +144,36 @@ struct Diff {
#[derive(Debug,
Args)]
struct
Mount
{
/// Commit name, sh: Glob is supported.
///
This is an optional parameter: if
not set then all commits will be
displayed
/// Commit name, sh: Glob is supported.
This is an optional parameter: if
/// not set then all commit
archive
s will be
mounted into the .mount directory
#[clap(short,
long)]
commit
:
Option
<
String
>
,
/// The file/directory to extract
///
This is an optional parameter. If not set
then all files in the archive will be displayed
/// The file/directory to extract
. This is an optional parameter. If not set
/// then all files in the archive will be displayed
#[clap(short,
long)]
path
:
Option
<
String
>
,
/// If set, displays the .mount directory in 'version view'.
///
/// - Normal view: The mount directory contains a subfolder with the name 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
/// - Normal view: The `.mount` directory contains a subfolder with the name
/// 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)]
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
()
{
...
...
@@ -201,7 +218,13 @@ fn main() {
}
Commands
::
Mount
(
mount
)
=>
{
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
=>
{
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