In SVN, doing svn update will show a list of full paths with a status prefix:
$ svn update
M foo/bar
U another/bar
Revision 123
I need to get this update list to do some post-process work. After I have transferred the SVN repository to Git, I can't find a way to get the update list:
$ git pull
Updating 9607ca4..61584c3
Fast-forward
.gitignore | 1 +
uni/.gitignore | 1 +
uni/package/cooldeb/.gitignore | 1 +
uni/package/cooldeb/Makefile.am | 2 +-
uni/package/cooldeb/VERSION.av | 10 +-
uni/package/cooldeb/cideb | 10 +-
uni/package/cooldeb/cooldeb.sh | 2 +-
uni/package/cooldeb/newdeb | 53 +++-
...update-and-deb-redist => update-and-deb-redist} | 5 +-
uni/utils/2tree/{list2tree => 2tree} | 12 +-
uni/utils/2tree/ChangeLog | 4 +-
uni/utils/2tree/Makefile.am | 2 +-
I can translate the Git pull status list to SVN's format:
M .gitignore
M uni/.gitignore
M uni/package/cooldeb/.gitignore
M uni/package/cooldeb/Makefile.am
M uni/package/cooldeb/VERSION.av
M uni/package/cooldeb/cideb
M uni/package/cooldeb/cooldeb.sh
M uni/package/cooldeb/newdeb
M ...update-and-deb-redist => update-and-deb-redist}
M uni/utils/2tree/{list2tree => 2tree}
M uni/utils/2tree/ChangeLog
M uni/utils/2tree/Makefile.am
However, some entries having long path names are abbreviated, such as uni/package/cooldeb/update-and-deb-redist is abbreviated to ...update-and-deb-redist.
I deem I can do with Git directly, maybe I can configure git pull's output in special format.
Any idea?
EDIT
I've figured out a resolution to this:
First, save the last and current commit to variable PREV and NEXT:
$ PREV=`git show --format=format:%H --summary | head -1`
$ git pull
$ NEXT=`git show --format=format:%H --summary | head -1`
And then, compare the two commit using special format:
$ git diff --name-status $PREV $NEXT
This will give the output:
A .gitignore
M uni/.gitignore
A uni/package/cooldeb/.gitignore
M uni/package/cooldeb/Makefile.am
M uni/package/cooldeb/VERSION.av
M uni/package/cooldeb/cideb
M uni/package/cooldeb/cooldeb.sh
...
Which is exactly the same as Subversion's.
Then, it's also easy to make it in preview mode:
$ PREV=`git show --format=format:%H --summary | head -1`
$ git stash
$ git pull
$ NEXT=`git show --format=format:%H --summary | head -1`
$ git diff --name-status $PREV $NEXT
$ git reset --hard $PREV
$ git stash pop
git pullto SVN's format? – Aleksandr Levchuk Jan 5 '11 at 23:44git pull -vdoesn't get the full pathnames. – Xiè Jìléi Jan 5 '11 at 23:47git pull --no-commitdo commit anyway. – Xiè Jìléi Jan 5 '11 at 23:58git pullthen you can see the full path like thisgit log --stat --raw -n 1- this will show the last commit files in raw format (to avoid openinglessusegit --no-pager ...) – Aleksandr Levchuk Jan 6 '11 at 0:25