-
Notifications
You must be signed in to change notification settings - Fork 123
Conversation
35e9cbc
to
adb7dfe
Compare
9cf997c
to
7458acd
Compare
32fa246
to
d79b382
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately still no reviews. Do more reviews for others and specifically ask others to do a review.
Anyway, the PR is a big progress. I am okay with replacing individual commands but without the possibility to compile kdb
completely without C++, the whole PR only goes the half way. This does not necessarily need to happen within this PR, though.
The main issue is that the release notes do not properly describe what was done. In particular it should point to tutorials/tests that fix bugs etc. What are your contributions? Which advantage to we have if we merge this PR?
@@ -324,6 +324,15 @@ This section keeps you up-to-date with the multi-language support provided by El | |||
- <<TODO>> | |||
- <<TODO>> | |||
|
|||
### KDB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make highlight out of it.
@@ -324,6 +324,15 @@ This section keeps you up-to-date with the multi-language support provided by El | |||
- <<TODO>> | |||
- <<TODO>> | |||
|
|||
### KDB | |||
|
|||
- Replace C++ of the CLI by a C version, C++ is fallback for not yet implemented commands _(@hannes99)_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is it possible to compile without having C++ (which was the goal)?
- Disable cascading writes as described in #3742 | ||
- Fix inconsistent return values #1563 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explain what exactly was done here and give examples (or link to new tests that show correct behavior).
- Add extra tests for CLI commands | ||
- Disable cascading writes as described in #3742 | ||
- Fix inconsistent return values #1563 | ||
- Update documentation, tutorials and examples where they would not match the new C version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link to the places where relevant/bigger changes were done.
@@ -91,43 +91,6 @@ The **proc** namespace is not accessible by the command line tool **kdb**, as it | |||
|
|||
The **spec** namespace is used to store metadata about keys and therefore Elektra handles the **spec** namespace differently to other namespaces. The following part of the tutorial is dedicated to the impact of the **spec** namespace on cascading lookups. | |||
|
|||
## Write Operations and the cascading Namespace | |||
|
|||
If a value is to be written to a cascading key, i.e., a key starting with '/', only cascading keys that resolve to an existing key will be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Demonstrate that it fails.
src/tools/kdb/cmerge.c
Outdated
@@ -0,0 +1,254 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only want cmerge
and it should be called merge
, the old merge
can be removed. See also #3131
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good work here! I added some notes. For some comments it makes sense to check other occurences.
|
||
#include <kdb.h> | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very minor, but what kind of function documentation do we follow in general? For some I see that we are doing documentation in the *.c
files and some things are documented in *.h
.
src/tools/kdb/get.c
Outdated
if (toLookUp == NULL) | ||
{ | ||
ELEKTRA_SET_VALIDATION_SEMANTIC_ERRORF (errorKey, "'%s' is not a valid key name", keyName (toLookUp)); | ||
keyDel (toLookUp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about moving all the free memory code to cleanup
section and check there if the variable is NULL and if not free the memory?
Key * printTrace (KeySet * ks, Key * key, Key * found, elektraLookupFlags options); | ||
Key * warnOnMeta (KeySet * ks, Key * key, Key * found, elektraLookupFlags options); | ||
void printOptions (elektraLookupFlags options); | ||
void setCallback (Key * key, Key * (*f) (KeySet * ks, Key * key, Key * found, elektraLookupFlags flags)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest describing what kind of callback should be set here. The signature of *f
is not really intuitive. And maybe also add some description for what the callback is needed.
|
||
const char * metaName = GET_OPTION (options, "metaname"); | ||
|
||
Key * toLookUp = keyNew (name, KEY_END); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest moving toLookUp
key initialization right before Key * key = ksLookup (conf, toLookUp, KDB_O_NONE);
. IIRC, I have read in our coding conventions CODING.md
that we should initialize code as late as possible and it is good practice in general.
src/tools/kdb/regex-wrapper.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe some description in this header file 🤔 ?
... and remove cpp implementation
... and remove cpp implementation
... and remove cpp implementation
... and remove cpp implementation
... and remove cpp implementation
13cb196
to
3dd3e33
Compare
.. remove cpp implementation and fix #3131
Added tests and if a command does not exist yet in C, the C++ implementation will be used. And due to #4444 the new implementation does not rely on specload anymore, support for it (
kdb --elektra-spec
) could be added easily if that would still make sense.Basics
(added as entry in
doc/news/_preparation_next_release.md
which contains_(my name)_
)Please always add them to the release notes.
(first line should have
module: short statement
syntax)close #X
, are in the commit messages.doc/news/_preparation_next_release.md
scripts/dev/reformat-all
Checklist
(not in the PR description)
Review
Labels