Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Git has great tools. It sounds like you'd want to see everything associated with a merge commit. If what you're looking for is a certain way to view changes, git's built in tooling usually has you covered regardless of commit strategy.

So if you know a commit sha and you'd like to see all of the merged branch changes associated with that commit as a single patch, I cooked up a script that takes a commit sha and finds the merge commit and show all the changes in a consolidated patch.

#!/bin/sh

merge_commit=$(git log -n1 --merges --pretty=format:"%H" $(git rev-list --ancestry-path $1..HEAD --merges -n1))

git show -m -p --stat --format="" $merge_commit



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: