GCC Code Coverage Report


Directory: cvmfs/
File: cvmfs/publish/cmd_diff.h
Date: 2025-06-22 02:36:02
Exec Total Coverage
Lines: 0 25 0.0%
Branches: 0 82 0.0%

Line Branch Exec Source
1 /**
2 * This file is part of the CernVM File System.
3 */
4
5 #ifndef CVMFS_PUBLISH_CMD_DIFF_H_
6 #define CVMFS_PUBLISH_CMD_DIFF_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "publish/command.h"
12
13 namespace publish {
14
15 class CmdDiff : public Command {
16 public:
17 virtual std::string GetName() const { return "diff"; }
18 virtual std::string GetBrief() const {
19 return "Show the change set between two repository revisions";
20 }
21 virtual std::string GetDescription() const {
22 return "Shows the added, removed, and modified files between any two "
23 "repository revisions. By default, shows the difference between the "
24 "current and the previous revision. The repository revision can be "
25 "given "
26 "by a tag name or by the root hash. In the latter case, the hash "
27 "needs to "
28 "start with a '@' symbol to distinguish it from a name.";
29 }
30 virtual std::string GetUsage() const {
31 return "[options] <repository name / url>";
32 }
33 virtual std::vector<std::string> DoGetExamples() const {
34 std::vector<std::string> e;
35 e.push_back(
36 "-k /etc/cvmfs/keys/cern.ch "
37 "http://cvmfs-stratum-one.cern.ch/cvmfs/grid.cern.ch "
38 " # use with any repository for which public keys are available");
39 e.push_back("myrepo.cvmfs.io "
40 "# use with a local stratum 0 or stratum 1 copy");
41 e.push_back(
42 "--from version1 --to version2 "
43 "# compare tags for the one and only stratum 0 or stratum 1 copy "
44 "available on this node");
45 return e;
46 }
47 virtual ParameterList GetParams() const {
48 ParameterList p;
49 p.push_back(Parameter::Optional(
50 "keychain", 'k', "directory",
51 "Path to the directory containing the repository public key"));
52 p.push_back(Parameter::Switch("machine-readable", 'm',
53 "Produce machine readable output"));
54 p.push_back(
55 Parameter::Optional("from", 's', "repository tag",
56 "The source tag name [default='trunk-previous']"));
57 p.push_back(
58 Parameter::Optional("to", 'd', "repository tag",
59 "The destination tag name [default='trunk']"));
60 p.push_back(Parameter::Switch(
61 "worktree", 'w',
62 "Show the diff of the unpublished changes in the open transaction"));
63 p.push_back(Parameter::Switch("header", 'h', "Show the header line"));
64 p.push_back(Parameter::Switch(
65 "ignore-timediff", 'i',
66 "Ignore changes that only differ in their timestamps"));
67 return p;
68 }
69
70 virtual int Main(const Options &options);
71 }; // class CmdDiff
72
73 } // namespace publish
74
75 #endif // CVMFS_PUBLISH_CMD_DIFF_H_
76