Re: Recent git changes and unmerged files



<snip>

>> The combination of those 2 commands should cover changes on the disk,
>> as well as to the index.  My understanding is that the "git-diff-index
>> HEAD --name-status" we currently use only compares the files on the
>> disk, and ignores the fact that the index is also modified/conflicted.
>> git-diff-index <tree-ish>
>> compares the <tree-ish> and the files on the filesystem.
>
> So this was a question on the bug report; what do we expect to see
> when you run Meld on a git (or other VCS with staging area concepts)
> repository?

Great question, I had never considered a user wouldn't want to see
their staged files.

> Personally, I wouldn't expect to see any changes that I'd already
> staged. In my mind, changes already present in the index are done, and
> I don't need to worry about them. I just want Meld to help me get the
> rest of it staged... but I realise that others may feel differently.

That makes sense.  I can see both sides too.  'git diff' behaves as
you describe - it only shows unstaged changes for what its worth.  For
me, the one big use of being able to view staged changes is to review
changes prior to finally committing them.  Eg during a large change I
might update the index multiple times and its nice to give those
changes one final review prior to committing them.

> If we want to include already staged changes *and* deal with unmerged
> statuses, etc. then your approach is probably the right one. If we
> don't need staged changes and such, then will git-diff-files suffice?

It seems like git-diff-files would suffice...  Also, the fact that it
mirrors the functionality of 'git-diff' is a pretty strong argument to
use it instead of the 'git-diff-files + git-diff-index'.  I'd think:
1. In a perfect world it'd be nice to support being able to diff both
staged and unstaged files.  Perhaps a "staged" filter like the current
Modified/Normal/NonVC ones, or possibly adding new states to the
"Status" column that could have values such as "Modified/Staged",
"Modified", "Added/Staged", etc.
2. If #1 is viewed as too invasive or not worth the effort, I like
your solution of just using 'git-diff-files -0'.

Best,
Peter


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]