I want to find the most recent non-grafted commit. My plan was to use git log --oneline and walk through the lines until I find one marked as grafted. This almost works; the file that pops up in vim looks as follows:
6a40aa9 (HEAD -> master, origin/master, origin/HEAD) Commit 8
e7e139a (grafted) Commit 7
6ada9c8 (grafted) Commit 1
This is exactly the output I am looking for. However, the output flushed to stdout does not include the grafted tags. For example, git log --oneline > file.txt makes file.txt:
6a40aa9 (HEAD -> master, origin/master, origin/HEAD) Commit 8
e7e139a Commit 7
6ada9c8 Commit 1
Is this a bug, or am I doing something wrong? Is there another or better way to find grafted commits?