The sound distributed version control system

#536 Tiny QoL improvements of `pijul diff`

Closed on December 7, 2021
potocpav on September 14, 2021
  • pijul diff --short didn’t respect the --untracked flag, so it was not very useful with many untracked files.
  • short alternatives for long commands

These changes make it possible to see untracked files using pijul diff -su, which is the feature I miss from git status the most.

Feel free to reject some of the changes, I won’t be sad :-) Maybe there are reasons to avoid shortening options just now.

potocpav added a change on September 14, 2021
F2AAJYHTJFK567FTQINEZBGRDSOSO3HX7NIZVGZTSOJTQJEGTWBQC
potocpav added a change on September 14, 2021
FO6DL4ETPXHILV7DQK54XP6SY4YUPG3NENRMKCDBU65WES6MKCHAC
main
ammkrn on September 23, 2021

To clarify about diff in general (not about your changes potocpav), is the intended behavior of --untracked to show a diff for ONLY the untracked files, or to add the diff for untracked files in addition to the rest of the diffs? The doc comment/help text seems to suggest the latter, but the current behavior is that it will show only the untracked diffs.

pmeunier on November 27, 2021

Oops, due to a bug in the Nest, I’ve lost these changes before I got a chance to merge them. Would you mind pushing them again to this discussion? Sorry :(

potocpav added a change on December 1, 2021
EWZ7VHV4N7QNK7GNG3FC6AQ6XVPH4ADJSUQADM7TZFYAD2AYNNTAC
main
potocpav on December 1, 2021

I re-pushed one of the changes, but I’m not sure it’s too great anymore.

My motivation was: I want to find which files I modified by calling pijul diff --short. But if my repository contains many files not tracked by Pijul, the results are drowned in the reports of untracked files (“U filename”). This would be solved by not showing these files, unless also the --untracked flag is present (implemented in the change above).

But still, the interaction of short and untracked is pretty weird. Current behavior:

short | untracked | show what
------+-----------+--------------------------------------------
      |           | diffs of tracked files
 yes  |           | *file names of modified and untracked files
      |    yes    | file names of untracked files
 yes  |    yes    | file names of modified and untracked files

patched behavior:

short | untracked | show what
------+-----------+--------------------------------------------
      |           | diffs of tracked files
 yes  |           | *file names of modified files
      |    yes    | file names of untracked files
 yes  |    yes    | file names of modified and untracked files

Difference marked with asterix. But it all seems quite illogical.

potocpav on December 1, 2021

Maybe this would be more logical, if we can display “diffs” of untracked files?

 command                        | effect
--------------------------------+---------------------------------------
diff                            | diffs of modified               files
diff         --all              | diffs of modified and untracked files
diff         --untracked        | diffs of              untracked files
diff --short                    | names of modified               files
diff --short --all              | names of modified and untracked files
diff --short --untracked        | names of              untracked files
pmeunier on December 7, 2021

I still think your patched behaviour is better than the current one, I’m merging. Thanks!

I’m also closing this discussion. You can either continue pushing after it’s closed if you want to implement --all, or open another one.

pmeunier closed this discussion on December 7, 2021