Skip to content

Legit status deleted file support, minor UI overhaul#1420

Merged
vindarel merged 5 commits intolem-project:mainfrom
jfaz1:main
Jul 9, 2024
Merged

Legit status deleted file support, minor UI overhaul#1420
vindarel merged 5 commits intolem-project:mainfrom
jfaz1:main

Conversation

@jfaz1
Copy link
Copy Markdown
Contributor

@jfaz1 jfaz1 commented Jul 9, 2024

This PR adds support for deleted files in Legit. It also incidentally overhauls a bit of the status UI.

Here's the before/after:
image

Change summary:

  • Deleted files now show up under staged/unstaged
  • Untracked files now have a diff preview
  • Number of files per section are now listed
  • Modifications now have their type listed to the left, similar to Magit (created/modified/deleted)

Deleted files don't have a diff preview as of right now, instead there's just a message stating the file has been deleted. Should probably be revisited at some point to have the deleted file's contents show up.

Also, I'm unfamiliar with Mercurial and Fossil. I attempted to keep it compatible, but I was unable to test properly on Fossil (couldn't commit with/without my changes). Mercurial is mostly fine, the only gripe is that while deleted files show fine in the UI, trying to stage them does nothing. If I had to guess the issue is probably here:

(defun hg-stage (file)
  (run-hg (list "add" file)))

Feel free to suggest or just make any changes!

@jfaz1 jfaz1 changed the title Legit status deleted file support, minor overhaul Legit status deleted file support, minor UI overhaul Jul 9, 2024
@vindarel
Copy link
Copy Markdown
Collaborator

vindarel commented Jul 9, 2024

LGTM

I was delighted to be able to pick Lem sources to start legit and I delighted to see another contributor can pick up my legit code.

Thanks for doing it.

@vindarel
Copy link
Copy Markdown
Collaborator

vindarel commented Jul 9, 2024

minor but necessary: please look at porcelain.lisp and legit.lisp top-level comments and at the README for the TODOs and update what's now done.

@jfaz1
Copy link
Copy Markdown
Contributor Author

jfaz1 commented Jul 9, 2024

@vindarel Thanks for the kind words! I removed the missing file TODO from porcelain.lisp. I think the legit.lisp feature list looks fine as is, since I just added support for staging deleted files, and staging is already there.

@mmontone
Copy link
Copy Markdown

mmontone commented Jul 9, 2024

This is nice. A cool next step could be to implement a legit-log command that opens a buffer and lists commits.

@vindarel
Copy link
Copy Markdown
Collaborator

vindarel commented Jul 9, 2024

This is nice. A cool next step could be to implement a legit-log command that opens a buffer and lists commits.

absolutely.

@vindarel vindarel merged commit 1b4bcf1 into lem-project:main Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants