Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 9dfa319180
Fetching contributors…

Cannot retrieve contributors at this time

executable file 62 lines (55 sloc) 1.407 kb
#!/bin/bash -e
## Check for updates, is an alias for
## git fetch --recurse-submodule=yes
## with some modifications of the output.
## read input, display help if necessary
if [[ "$@" == *--help* ]]; then
cat<<EOF
Recursive fetch
This command recursively fetches changes from origin.
(Up to output it is equal to running
git fetch --recurse-submodules=yes.)
Usage:
git rfetch ...
...: same arguments as git fetch
EOF
exit 0;
fi
## from the git mailinglist:
function git
{
LC_MESSAGES=C command git "$@"
}
export git
## run fetch
tmp=`git fetch --recurse-submodules=yes "$@" 2>&1`
## and process output
last="_start_"
output=""
while read line; do
if [[ "${line:0:5}" == "Fetch" ]]; then
last="$line"
elif [[ "${line:0:4}" == "From" ]]; then
if [[ "$last" == "_start_" ]]; then
output="${output}There are updates available for the current repository.
"
elif [[ "$last" != "" ]]; then
output="${output}There are updates available for ${last:19}.
"
fi
last=""
fi
done <<< "$tmp"
if [[ "$output" ]]; then
if [[ "$@" == "--dry-run" ]]; then
cat<<EOF
${output}Use "git rfetch" to fetch updates.
Then go to the innermost submodules and use "git rpull" to merge the updates.
EOF
else
cat<<EOF
${output}Fetched updates. Now use "git rdiff" to show the differing files.
Then "git rpull" in the correct folder to merge updates.
EOF
fi
fi
Jump to Line
Something went wrong with that request. Please try again.