The sound distributed version control system

#677 push and pull command output needs more detail

Opened by joyously on April 26, 2022
joyously on April 26, 2022

Trying to understand the syntax of the push command, I think both push and pull need to say exactly what they are doing.

There also needs to be a good way to cancel out of an interactive command. This would especially apply to the situation described in #675 (Bringing back unrecorded patches).

The help for push says

pijul push [OPTIONS] [TO] [-- <CHANGES>...]

So I wondered what the push command would do if I specified a repo and no destination.

/Data/pijul2$ pijul push --repository /Data/pijul3 
Nothing to push
/Data/pijul2$ pijul push --repository /Data/pijul3 .

Use "fg" to return to nano.

[1]+  Stopped                 pijul push --repository /Data/pijul3 .
/Data/pijul2$ ^C
/Data/pijul2$ fg
pijul push --repository /Data/pijul3 .
Uploading changes [==================================================] 12/12                       

With no destination, it said nothing to push (there was a delay while it checked though).

With a destination of ., it had 12 changes. I hit Ctrl Z to get out and tried Ctrl C to stop it, but that didn’t do it. I guess I should have used kill, but I really wanted out while in the editor. I know I could delete all lines so there would be nothing to do, but I don’t know that editor so I don’t even know how to do that. When I let it run, it pushed 12 changes. Did they go from pijul3 to pijul2? What was the first command doing?

I think the command should say a bit more about direction, even including it in the comment at the top of the file.

spacefrogg on April 27, 2022
/Data/pijul2$ pijul push --repository /Data/pijul3

This seems to be interpreted as “push from pijul3 to pijul3”, which is always a no-op. This is an error. The command should complain with: “Error: Missing remote” as it does for pijul push (w/o any arguments).

/Data/pijul2$ pijul push --repository /Data/pijul3 .

This (rightfully) means “act from pijul3; push to ‘.’ (which points to pijul2); thus, push from pijul3 to pijul2”. This is equivalent to the following shell commands:

cd /Data/pijul3
pijul push /Data/pijul2
cd /Data/pijul2

N.B. You can set your editor of choice by setting the EDITOR or the VISUAL environment variable, e.g. export VISUAL=emacs before running pijul push. VISUAL takes precedence over EDITOR should both be set.