Re: Best way to check whether working tree matches a commit's tree

2017-08-22 Thread Sebastian Schuberth
On Tue, Aug 22, 2017 at 9:34 PM, Junio C Hamano wrote: >> While this works, it feels sub-optimal. Is there a better / smarter way? > > I do not think so; you want three things to match and you have a way > to compare two things at a time. Right. I was just thinking if there's

Re: Best way to check whether working tree matches a commit's tree

2017-08-22 Thread Junio C Hamano
Sebastian Schuberth writes: > Hi, > > I'd like to check whether my working tree exactly matches the tree of a given > commit. That is, there should not be any untracked, staged or modified files > (including ignored files). > > Currently, I'm doing this in two steps: > >

Best way to check whether working tree matches a commit's tree

2017-08-22 Thread Sebastian Schuberth
Hi, I'd like to check whether my working tree exactly matches the tree of a given commit. That is, there should not be any untracked, staged or modified files (including ignored files). Currently, I'm doing this in two steps: - check for success and empty output of "git status --ignored