{"id":16310678,"url":"https://github.com/nkh/tdiff","last_synced_at":"2025-06-27T22:05:23.275Z","repository":{"id":186337172,"uuid":"675011716","full_name":"nkh/tdiff","owner":"nkh","description":"an interactive  terminal directory diff application","archived":false,"fork":false,"pushed_at":"2025-03-06T23:06:18.000Z","size":346,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-27T22:03:31.808Z","etag":null,"topics":["bash","cli","diff","directory","interactive","terminal","tree","tui"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nkh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-05T13:35:37.000Z","updated_at":"2025-04-03T12:39:14.000Z","dependencies_parsed_at":"2023-09-26T18:15:59.340Z","dependency_job_id":"97e2e137-687e-4d60-80ae-8595b268a93c","html_url":"https://github.com/nkh/tdiff","commit_stats":{"total_commits":26,"total_committers":1,"mean_commits":26.0,"dds":0.0,"last_synced_commit":"fcc5210476600f688599f7a56c350838b9adf8d9"},"previous_names":["nkh/tdiff"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nkh/tdiff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkh%2Ftdiff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkh%2Ftdiff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkh%2Ftdiff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkh%2Ftdiff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nkh","download_url":"https://codeload.github.com/nkh/tdiff/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkh%2Ftdiff/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262341623,"owners_count":23296069,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","cli","diff","directory","interactive","terminal","tree","tui"],"created_at":"2024-10-10T21:42:44.208Z","updated_at":"2025-06-27T22:05:23.235Z","avatar_url":"https://github.com/nkh.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\n\ttdiff - interactive tree diff\n\n![COMMON](https://github.com/nkh/tdiff/blob/main/media/mode_common.png)\n\n# SYNOPSIS\n\n\ttdiff [options] dir1 dir2\n\n# Options\n\n| short      | long          | function                                         |\n| ---------- | ------------- | ------------------------------------------------ |\n| -g         |               | generate diff data and exit                      |\n| -m         | --mode        | modes: all/common/diff, default:common           |\n| -M         |               | display manifest                                 |\n\n# DESCRIPTION\n\n***tdiff*** presents a diff between two directories, as one or two trees, highlighting differences.\n\nI wrote *tdiff* because I couldn't find a TUI application with the functionality I needed. If you know of any please let me know.\n\nI wrote *tdiff* for myself so it fits my needs and taste, and environment, but I hope it will be useful to other.\n\nIdeas, discussions, and patches are welcome. \n\n## Highlighting\n\nOne or two trees with highlighted differences are displayed in the terminal depending on the mode.\n\n- missing file in one of the trees are displayed with a red background\n- files with differences have a yellow background\n\nWhile working in *tdiff* you may modify, delete, or copy files, the background color will be adjusted to reflect the change.\n\n- if you delete a file it will be displayed with a red background, lighter in color so you can see the difference between the files that didn't exist and those you have removed\n- copied files are displayed with a blue background\n- merged files are displayed with a green background\n\n## Modes\n\nDefault mode: **common**\n\n| mode        | operation                                            | usage                                      |\n| ----------- | ---------------------------------------------------- | ------------------------------------------ |\n| all         | show all the files in the directories                | for general directory diffs                |\n| common      | show all the files that are different or deleted     | for synchronizing directories              |\n| diff        | show a single tree with the files that are different | for fixing merge conflicts                 |\n| all_d2_only | show a single tree for directory 2                   | prototype mode with diffs in a single tree |\n\n![ALL](https://github.com/nkh/tdiff/blob/main/media/mode_all.png)\n\n![COMMON](https://github.com/nkh/tdiff/blob/main/media/mode_common.png)\n\n![DIFF](https://github.com/nkh/tdiff/blob/main/media/mode_diff.png)\n\n![ALL_ONLY_D2](https://github.com/nkh/tdiff/blob/main/media/mode_only_d2.png)\n\n## Diff refresh\n\nThere are bindings to change mode but be aware that the mode trees are not automatically synchronized.\n\nA quick explanation ...\n\n- *tdiff* efficiently generates all the trees simultaneously before presenting its UI\n- different modes have different trees\n- interactive modification don't re-generated the trees, they only color them\n\nWhat's the case to be aware of?\n\n- in the modes that list identical files, *all* and *d2_only*\n- you modify only one of the file, thus making them different\n- you change to a mode which doesn't display identical files, *common* or *diff*\n\nThe file you have modified will not be listed because it wasn't in the tree when generated.\n\nThe above case is not different from a file being changed by another process. \n\n***You can manually refresh the diff.***\n\n# Current entry and movements\n\n***tdiff's top line is the current entry.***\n\nApart from the up/down movements you can:\n\n- jump \n\t- to the next/previous change\n\t- to the next/previous difference\n\t- to the next/previous entry at the same path depth\n\t- to the next/previous entry at a lower path depth\n- search for a changed file\n- search for any file\n\n## Fixing differences in files, ie: git merge conflicts\n\nPressing **Return** will open the files in *vimdiff* (configurable)\n\nIf the *auto_advance* variable is set and the files are identical after editing, the next difference will be selected. \n\n## A file on one side and nothing on the other side\n\nThe file that exists will be open in *vim*.\n\n## Copy files and directories\n\nYou can copy files or directories from one side to the other using \u003ccl\u003e or \u003ccr\u003e. If you try to copy a file that doesn't exist the file in the other tree will be deleted.\n\n## Delete files or directories\n\nYou can delete files and directories on one side or on both sides.\n\n## File management\n\nIf you configure a file manager, you can open both tree in it, see the configuration for an example.\n\n## Divers functions\n\nCopy the paths to the clipboard.\n\n# Bindings\n\nSee ***Paneless*** for default bindings https://github.com/nkh/paneless\n\n## Tdiff bindings\n\n| binding | function                     |\n| ------- | ---------------------------- |\n| ?       | show bindings                |\n| r       | refresh diff                 |\n| m/M     | next/previous mode           |\n| n/N     | next/previous change         |\n| v/V     | next/previous difference     |\n| a       | scroll up one level          |\n| z       | scroll down one level        |\n| s       | scroll up same level         |\n| x       | scroll down same level       |\n| b       | fzf to diff                  |\n| B       | fzf to file                  |\n| dd      | delete both sides            |\n| dl      | delete left side             |\n| dr      | delete right side            |\n| cl      | copy to left side            |\n| cr      | copy to right side           |\n| yy      | copy both path to clipboard  |\n| yl      | copy left path to clipboard  |\n| yr      | copy right path to clipboard |\n| ENTER   | open diff/file/directory     |\n| F       | open file manager            |\n| i       | display stats                |\n| AL      | flip Action Left             |\n| ZL      | flip line number overlay     |\n| ZL      | flip line total              |\n\n# CONFIGURATION\n\nAt the top of the *tdiff.pless* file you will find these configuration variables, they will be moved to a configuration file in future versions.\n\n```bash\n# diff colors\nDELETED=$'...'\nDIFF=$'...'\nONLY=$'...'\n\n# color for elements you have manipulated\nINT_DELETED=$'...'\nINT_DIFF=$'...'\nINT_COPIED=$'...'\nINT_SYNCHED=$'...'\n\nauto_advance=1             # go to next file diff automatically\nconfirmation=              # set to 1 to confirm actions\nleft_side_action=1         # allow \"delete in\" / \"copy to\" the left side tree \n\nDIFF_TOOL=vimdiff\nFILE_EDIT=vim\nDIR_EDIT=open_in_ftl\n\nopen_in_ftl() { tabs= ; for p in \"$PWD/$1/$3\" \"$PWD/$2/$3\" ; do [[ -e \"$p\" ]] \u0026\u0026 tabs+=\"$p$'\\n'\" ; done ; tmux new-window \"ftl -t \u003c(echo -n \"$tabs\")\" ; }\n```\nThey reflect my environment so you'll need to set them up if they don't match yours. You certainly will have to set your file manager.\n\n## Color Vision Deficiencies\n\nYou can set colors and intensities that suits you best in the configuration and also use the terminal codes below. Let me know what worked best for you.\n\n| code  | effect        |\n| ----- | ------------- |\n| \\e[3m | italic        |\n| \\e[4m | underline     |\n| \\e[5m | blinking      |\n| \\e[9m | strikethrough |\n\n## Extra Config\n\n### Sort order\n\n\tLC_COLLATE=C tdiff test1 test2\n\n### Limiting entry types by passing argument to *find(1)*\n\n\tTDFA='-type d' tdiff test/dir*\n\n# DEPENDENCIES\n\n- Bash\n- diff\n- tree\n- Paneless https://github.com/nkh/paneless\n- Perl\n- Awk\n- FZF\n\n# INSTALL\n\nClone the repository and add it to your PATH; or link/copy the files to somewhere in your PATH.\n\n# CONFIGURATION\n\nThe *tdiff* file you run contains the configuration and bindings (press 'c' to see the bindings in FZF).\n\n# AUTHORS\n\n\tKhemir Nadim ibn Hamouda\n\thttps://github.com/nkh\n\tCPAN ID: NKH\n    \n# LICENCE\n\n\t© Nadim Khemir 2023, Artistic licence 2.0\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnkh%2Ftdiff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnkh%2Ftdiff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnkh%2Ftdiff/lists"}