Ticket #4232 (closed task: fixed)

Opened 3 years ago

Last modified 6 months ago

FISH: drop compatibility with FISH protocol

Reported by: andrew_b Owned by: andrew_b
Priority: major Milestone: 4.8.31
Component: mc-vfs Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description

Does anybody know any implementation of FISH server as described in README.fish and Wikipedia? I can't find none of them.

My ask is following: should we keep the compatibility with unimplemented server?

FISH protocol has some limitations, and those limitations don't allow us to resolve #77 and #68.

Let's look at FISH command of getting file from the remote host:

#RETR /path/and/filename <offset>

Using this command, we must get a part of file from offset to the end only. We can't get a chunk of file from offset1 to offset2. And moreover:

Note that there's no way to abort running RETR command - except closing the connection.

The same situation with the commands of sending file to remote host:

#STOR <size> /path/and/filename

#APPE <size> /path/and/filename

We cannot send a chunk of file from offset1 to offset2. If we start to send a file with specified <size>, we must transmit all specified <size> bytes.

As a result, we have to use the intermediate storage for transferring files because we must transfer file wholly, not small chunk by small chunk with ability of transfer interruption.

Extending FISH protocol is pointless because who will support those extensions?

Let's forget about the compatibility with FISH command formats. Let's just send shell scripts with arguments that are convenient for us to the remote host and get results of script work. The part of FISH protocol relative to remote host answers will be used as is.

Change History

comment:1 Changed 7 months ago by andrew_b

  • Owner set to andrew_b
  • Status changed from new to accepted
  • Milestone changed from Future Releases to 4.8.31

Branch: 4232_drop_fish_protocol
changeset:f42d67432bf76b6e8e2b2d9b5cb70b4f62b549a3

comment:2 Changed 7 months ago by zaytsev

I have no problem dropping FISH server "compatibility" since there is no known FISH server to the humankind. I think this was the idea of Pavel, but it never happened this way. Instead other people got inspired by the protocol (I know it's used in KDE), but it was always implemented on the client side. Basically, expect that ssh server provides some kind of POSIXy environment, however crippled, and send POSIX snippets that are run in the shell to execute commands. Something like Ansible does with Python.

Maybe it's worth noting that far2l people are actively working on implementing FISH, but they can't take code from us, because they are GPL 2 and we are GPL 3+: https://github.com/elfmz/far2l/issues/1819 - their idea seems to be to write a FISH server in POSIXy stuff and talk to that, instead of sending shell scripts every command. Maybe we can take code from them if we want, and it doesn't make sense to actively break FISH protocol compatibility unless we really need it for some commands :)

I think our commands are good enough after the last rewrite in that they kind of work, what is not so great is the implementation - I would have documented the userlands that they target and wrapped them into functions so that the structure is clear and everything can be modified in a much easier way. The test situation I think is also not so great...

comment:3 follow-up: ↓ 4 Changed 7 months ago by zaytsev

By the way, why do we still have the hardcoded scripts in the header file in the first place? I thought actually everything is working via scripts in files. Maybe the hardcoded scripts should be removed...

comment:4 in reply to: ↑ 3 Changed 7 months ago by andrew_b

Replying to zaytsev:

By the way, why do we still have the hardcoded scripts in the header file in the first place?

Key bindings too.

I thought actually everything is working via scripts in files. Maybe the hardcoded scripts should be removed...

As I remember, the idea was have more or less working mc with minimum number of external files.

Last edited 7 months ago by andrew_b (previous) (diff)

comment:5 Changed 7 months ago by andrew_b

  • Branch state changed from no branch to on review

comment:6 Changed 7 months ago by andrew_b

The next (obvious?) step is to rename fish to shell, because modified VFS is no longer related to the FISH protocol.

comment:7 follow-up: ↓ 8 Changed 7 months ago by zaytsev

Well, I think it would be at least good to keep the alias fish:// for the console not to anger people needlessly by changing something that doesn't need to change.

comment:8 in reply to: ↑ 7 Changed 7 months ago by andrew_b

Replying to zaytsev:

keep the alias fish://

fish:// wasnt't ever used. There was /#sh: once upon a time and sh:// now. I keep 'fish' in history name.

comment:9 Changed 6 months ago by andrew_b

  • Votes for changeset set to andrew_b
  • Branch state changed from on review to approved

comment:10 Changed 6 months ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from andrew_b to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

Merged to master: [74d9f248586940d4bf1df03263affe4ab561cad6].

git log --oneline 3e4433377..74d9f2485

comment:11 Changed 6 months ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.