Affects git-credential-himitsu, since git uses its credential helpers to inserts any keys that it uses back into the store, creating a new duplicate on each run.
I would like to try an address this. Does simply yielding the same result that is returned for non-duplicates sound good, or would you prefer a dedicated error response?
Probably needs an error, since we have to assume
private!=foo private!=bar
are the same key
What would the mechanic to update an existing key? Could we have a flag to insert-or-update?
A flag would probably be good, yeah.
I've a WIP changes for this here, but am missing the most important parts in
exec_add
.https://git.sr.ht/~whynothugo/himitsu/commit/6eac52e42bbcd8f80498bb753119f8768d0e8ffa
Some early questions before proceeding:
- For a duplicate entry, should I add a new error type to
cmderror
(e.g.:duplicate_entry
)?- When the
update
flag is provided, is deleted-then-insert okay? I think it's much simpler than implementing rewriting at a lower layer.- Should we prompt users to confirm updates?
- In case the
-u
flag (update) is provided, and no matching entry exists: should I fail, or simply proceed with insertion?
yes
sure
no
fail, unless -au are both provided
Oh, so I guess it should be possible to specify
-u
without specifying-a
. I had not accounted for that.