Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce configuration file #7

Open
przemoc opened this issue Mar 2, 2014 · 4 comments
Open

Introduce configuration file #7

przemoc opened this issue Mar 2, 2014 · 4 comments
Milestone

Comments

@przemoc
Copy link
Owner

przemoc commented Mar 2, 2014

Configuration files will be optional and they will be read in following order:

  • /etc/metastore.conf (system options)
  • $HOME/.metastore.conf (global options)
  • $CWD/.metastore.conf (local options)

The format will be most likely INI-like (key = value), but without any sections.

Options theoretically required to support current features:

  • verbosity = INT - verbosity level (0 by default)
  • mtime = BOOL - should mtime be considered when applying or diffing metadata? (no by default)
  • empty-dirs = BOOL - recreate missing empty directories (no by default)
  • git = BOOL - do not omit .git directories (no by default)
  • file = STR - metadata file (.metadata by default)

Options required to support future features:

  • format = STR - metadata file format (0 by default, v001t for new one)
  • format-convert = BOOL - should metadata file be converted to chosen format even if present file uses other one? (no by default)
  • exclude = STR - exclude dirs/files that match pattern (.git by default)
  • exclude-from = STR - exclude dirs/files that match any pattern in file
  • exclude-reset = BOOL - removes all excludes defined earlier using exclude when true
  • exclude-from-reset = BOOL - removes all excludes defined earlier using exclude-from when true (no-op when false)
  • remove-empty-dirs = BOOL - remove empty directories not present in applied metadata file (no by default)
  • work-on-parameters = STR - parameters that should be considered when diffing or applying metadata ("mox" by default)

Some options theoretically required to support current features would be better not present at all. When exclude will be available, there will be no need for git, as it would complicate things more (ignoring .git directories being excluded...). Similarly work-on-parameters is much nicer than specific mtime.

@JPT77
Copy link

JPT77 commented Nov 30, 2014

Hi,
could you please add options which meta-data to save?
imho user:group very often doesn't make any sense because being ordinary user you are not allowed to change user:group, and if another user checks out, he almost certainly won't be you ;)
I only need mtime, because currently I am working on data which is really,really old (from Apple II 1988) and I want to preserve timestamps.

for example:
save=user,group,mtime,atime,chmod
apply=*
diff=mtime

If you like I can help, but until January I'm on vacation.

@JPT77
Copy link

JPT77 commented Nov 30, 2014

Another idea:
add [] sections. The content would be a regex pattern to match files.
any files matched would use the config in this section.

[.*]
store=mtime

[shadow]
store=mtime,chmod

[.*.bak]
store=

thanks

@przemoc przemoc modified the milestone: v2.0.0 Feb 8, 2015
@przemoc
Copy link
Owner Author

przemoc commented Feb 8, 2015

@JPT77 What you wrote in your first comment, was already partly mentioned in the issue description

work-on-parameters

I'm not sure I like the idea of non-symmetrical store/apply, but it may have its use. Could you clarify, though, what you meant by diff option?

Regarding your second comment, per-regexp options may be problematic ordering- and performance-wise.

@JPT77
Copy link

JPT77 commented Feb 10, 2015

diff is which type of metadata to show if you do a metastore -c.
Yes, this already was mentioned. I am sorry.

You are right, most time one will store exactly the metadata which is important for him. And this data he will apply and compare.

I started my own metastore written in java. Well: It's not that trivial if you want to implement my ideas. Won't ever be finished almost certainly. ;)
During coding I happend to see the problem of the order of regex-pattern matching.
Maybe we can solve it with named sections that define how to match and what to do.
[anyname]
pattern=
priority=
filetypes=
(otherconfig)

Ok, this isn't top priority. ;) An asci format metastore would be waaayyy more important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants