dim: rename rebuild-nightly to rebuild-tip
PATCH 1/7 dim: rename rebuild-nightly to rebuild-tip
Keep update-branches as an alias.
--- dim | 5 +++-- dim.rst | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-)
dim +3 -2
@@ -374,7 +374,8 @@ function dim_revert_rerere rm `rr_cache_dir`/* -Rf } -function dim_rebuild_nightly +dim_alias_rebuild_nightly=rebuild-tip +function dim_rebuild_tip { local integration_branch=drm-tip local specfile=`mktemp`
@@ -512,7 +513,7 @@ function dim_push_branch update_linux_next $branch drm-intel-next-queued drm-intel-next-fixes drm-intel-fixes update_linux_next $branch drm-misc-next drm-misc-next-fixes drm-misc-fixes - dim_rebuild_nightly + dim_rebuild_tip } dim_alias_pq=push-queued
dim.rst +3 -4
@@ -85,10 +85,9 @@ always maintained from the same machine, even if different branches are maintained on different machines (by different maintainers), there's no need to run this command. -rebuild-nightly ---------------- -Rebuilds the nightly branch. Useful when ad-hoc trees are -included in -nightly. +rebuild-tip +----------- +Rebuild and push the integration tree. revert-rerere *rerere-cache-commit-ish* ---------------------------------------
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/7 dim: fix references to anything "nightly" in dim and documentation
Reference drm-tip, use $integration_config, or just drop old/stale comments.
--- dim | 18 ++++++++---------- dim.rst | 13 ++++--------- drm-intel.rst | 6 +++--- 3 files changed, 15 insertions(+), 22 deletions(-)
dim +8 -10
@@ -342,7 +342,7 @@ function check_conflicts # tree # we need an empty line to make it look pretty echoerr "" echoerr "FAILURE: Could not merge $1" - echoerr "See the section \"Resolving Conflicts when Rebuilding drm-intel-nightly\"" + echoerr "See the section \"Resolving Conflicts when Rebuilding drm-tip\"" echoerr "in the drm-intel.rst documentation for how to handle this situation." exit 1 fi
@@ -464,10 +464,10 @@ function dim_rebuild_tip git commit --quiet -m "$integration_branch: $time integration manifest" echo "Done." - local nightly_remote=`url_to_remote $drm_tip_ssh` + local tip_remote=`url_to_remote $drm_tip_ssh` echo -n "Pushing $integration_branch... " - git push $DRY_RUN $nightly_remote +HEAD >& /dev/null && echo "Done." + git push $DRY_RUN $tip_remote +HEAD >& /dev/null && echo "Done." echo -n "Updating rerere cache... " cd $rerere
@@ -492,7 +492,7 @@ function dim_rebuild_tip exit 1 fi } -# push branch $1, rebuild nightly. the rest of the arguments are passed to git +# push branch $1, rebuild drm-tip. the rest of the arguments are passed to git # push. function dim_push_branch {
@@ -600,7 +600,6 @@ function dim_cherry_pick sha=`git rev-parse $1` sha_short=${sha:0:8} - # need latest -nightly git fetch $remote echo Possible fixup patches for your cherry-pick: git log --grep=$sha_short --pretty=oneline $sha..$remote/drm-tip
@@ -770,7 +769,7 @@ function dim_remove_branch local repo=`branch_to_repo $branch` if [[ $repo == "" ]] ; then - echoerr "$branch not found in nightly.conf" + echoerr "$branch not found in $integration_config" exit 1 fi
@@ -817,7 +816,7 @@ function dim_checkout fi if [[ $repo == "" ]] ; then - echoerr "$branch not found in nightly.conf" + echoerr "$branch not found in $integration_config" exit 1 fi
@@ -1054,7 +1053,7 @@ function dim_update_next_continue $DRY git tag -f -a $tag $DIM_DRM_INTEL_REMOTE/drm-intel-next git push $DRY_RUN -f $DIM_DRM_INTEL_REMOTE $tag - echo "Updating -testing to latest -nightly" + echo "Updating drm-intel-testing to latest drm-tip" git push $DRY_RUN $DIM_DRM_INTEL_REMOTE +$remote/drm-tip:drm-intel-testing $DRY git tag -f drm-intel-testing-$today $DIM_DRM_INTEL_REMOTE/drm-intel-testing $DRY git push -f $DIM_DRM_INTEL_REMOTE drm-intel-testing-$today
@@ -1209,8 +1208,7 @@ function dim_update_branches done dim_checkout drm-intel-next $DRY git reset --hard $DIM_DRM_INTEL_REMOTE/drm-intel-next - # TODO: Restore -nightly merge state from the rerere-cache - # branch + update_rerere_cache }
dim.rst +4 -9
@@ -72,11 +72,6 @@ setup *prefix* -------------- Setup git maintainer branches in the given prefix. -nightly-forget --------------- -Forget git rerere solutions for nightly merges in case they -contain a bogus merge resolution. - update-branches --------------- Updates all maintainer branches. Only needs to be run to synchronize branches
@@ -96,13 +91,13 @@ When a stored conflict resolution in the integration tree is wrong, this command can be used to fix up the mess. First figure out which commit in the *rerere-cache* branch contains the bogus conflict resolution, then revert it using this command. This ensures the resolution is also purged from any local -caches, to make sure it doesn't get resurrected. Then run *rebuild-nightly* to +caches, to make sure it doesn't get resurrected. Then run *rebuild-tip* to redo the merges, correctly. cat-to-fixup ------------ -Pipes stdin into the fixup patch file for the current -nightly merge. +Pipes stdin into the fixup patch file for the current drm-tip merge. push-branch branch [*git push arguments*] -----------------------------------------
@@ -245,12 +240,12 @@ goes wrong. update-next ----------- Pushes out the latest dinq to drm-intel-next and tags it. Also -pushes out the latest nightly to drm-intel-testing. For an +pushes out the latest drm-tip to drm-intel-testing. For an overview a gitk view of the currently unmerged feature pile is opened. Also checks that the drm-intel-fixes|-next-queued are fully -merged into -nightly to avoid operator error. +merged into drm-tip to avoid operator error. tag-next --------
drm-intel.rst +3 -3
@@ -241,9 +241,9 @@ when it's tricky or something fails in the below procedure. 1. First check that drm-intel-next-queued was indeed pushed correctly and that your local and remote branches match. -2. Then re-run the -nightly generation just to confirm: :: +2. Then rebuild the integration branch just to confirm: :: - $ dim rebuild-nightly + $ dim rebuild-tip It's handy to keep the log output for context so that you know which branch caused the conflicts, and which branches are already included.
@@ -268,7 +268,7 @@ when it's tricky or something fails in the below procedure. match up your resolution with the conflict for odd reasons) and to make sure there's no other conflict in later merges: :: - $ dim rebuild-nightly + $ dim rebuild-tip This will also push the stored conflict resolution to the drm-intel-rerere branch and therefore publishes your resolution. Everything before this step
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/7 dim: do not do local variable assignments in declaration
In reply to Jani NikulaWe rely on 'set -e' to bail out on errors. We also do a lot of local variable assignments with command substitution like this:
local foo=$(bar)
However, that masks the return value of the command, failing to bail out on errors. Split up local variable declarations from assignments to avoid the problems.
There are no issues with literal assignments like
local foo="bar"
but split those out too for more uniform code, preferring to have local declarations in the beginning of functions or nested blocks.
Details at
http://stackoverflow.com/questions/4421257/why-does-local-sweep-the-return-code-of-a-command
--- dim | 202 +++++++++++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 127 insertions(+), 75 deletions(-)
dim +127 -75
@@ -199,14 +199,16 @@ fi function url_to_remote # url { - local url="$1" + local url remote + + url="$1" if [[ -z "$url" ]]; then echoerr "$0 without url" exit 1 fi - local remote=$(git remote -v | grep -m 1 "$url" | cut -f 1) + remote=$(git remote -v | grep -m 1 "$url" | cut -f 1) if [[ -z "$remote" ]]; then echoerr "No git remote for url $url found in $(pwd)"
@@ -221,7 +223,9 @@ function url_to_remote # url function branch_to_remote # branch { - local remote=`git rev-parse --abbrev-ref --symbolic-full-name $1@{upstream}` + local remote + + remote=`git rev-parse --abbrev-ref --symbolic-full-name $1@{upstream}` remote=${remote%%/*} echo $remote
@@ -248,7 +252,9 @@ function branch_to_repo # branch function dim_uptodate { - local using="${BASH_SOURCE[0]}" + local using + + using="${BASH_SOURCE[0]}" if [[ ! -e "$using" ]]; then echoerr "could not figure out the version being used ($using)."
@@ -300,19 +306,21 @@ function dim_commit_add_tag # update for-linux-next and for-linux-next-fixes branches function update_linux_next # branch next next-fixes fixes { + local branch linux_next linux_next_fixes linux_fixes repo remote + cd $DIM_PREFIX/drm-tip - local branch=$1 - local linux_next=$2 - local linux_next_fixes=$3 - local linux_fixes=$4 + branch=$1 + linux_next=$2 + linux_next_fixes=$3 + linux_fixes=$4 - local repo=`branch_to_repo $branch` + repo=`branch_to_repo $branch` if [[ $repo != `branch_to_repo $linux_next` ]] ; then return fi - local remote=`repo_to_remote $repo` + remote=`repo_to_remote $repo` # always update drm-intel-fixes echo -n "Pushing $linux_fixes to for-linux-next-fixes... "
@@ -377,12 +385,14 @@ function dim_revert_rerere dim_alias_rebuild_nightly=rebuild-tip function dim_rebuild_tip { - local integration_branch=drm-tip - local specfile=`mktemp` - local time="`date --utc +%Yy-%mm-%dd-%Hh-%Mm-%Ss` UTC" - local first=1 + local integration_branch specfile time first rerere repo url remote - local rerere=$DIM_PREFIX/drm-rerere + integration_branch=drm-tip + specfile=`mktemp` + time="`date --utc +%Yy-%mm-%dd-%Hh-%Mm-%Ss` UTC" + first=1 + + rerere=$DIM_PREFIX/drm-rerere cd $rerere if [[ `git status --porcelain | grep -v "^[ ?][ ?]" | wc -l` -gt 0 ]]; then
@@ -404,8 +414,8 @@ function dim_rebuild_tip fi for repo in "${!drm_tip_repos[@]}"; do - local url=${drm_tip_repos[$repo]} - local remote=$(url_to_remote $url) + url=${drm_tip_repos[$repo]} + remote=$(url_to_remote $url) echo -n "Fetching $repo (as $remote) ... " # git fetch returns 128 if there's nothing to be fetched git fetch $remote >& /dev/null || true
@@ -414,11 +424,12 @@ function dim_rebuild_tip # merge -fixes for conf in "${drm_tip_config[@]}"; do - local repo branch override + local branch override sha1 fixup_file + read repo branch override <<< $conf - local url=${drm_tip_repos[$repo]} - local remote=$(url_to_remote $url) - local sha1=$remote/$branch + url=${drm_tip_repos[$repo]} + remote=$(url_to_remote $url) + sha1=$remote/$branch echo -n "Merging $repo (local remote $remote) $branch... "
@@ -436,7 +447,7 @@ function dim_rebuild_tip echo "Fast-forward. Done." true else - local fixup_file=$rerere/$repo-${branch//\//-}-fixup.patch + fixup_file=$rerere/$repo-${branch//\//-}-fixup.patch echo $fixup_file > .fixup_file_path git merge --rerere-autoupdate --no-commit $sha1 >& /dev/null || true
@@ -464,15 +475,15 @@ function dim_rebuild_tip git commit --quiet -m "$integration_branch: $time integration manifest" echo "Done." - local tip_remote=`url_to_remote $drm_tip_ssh` + remote=`url_to_remote $drm_tip_ssh` echo -n "Pushing $integration_branch... " - git push $DRY_RUN $tip_remote +HEAD >& /dev/null && echo "Done." + git push $DRY_RUN $remote +HEAD >& /dev/null && echo "Done." echo -n "Updating rerere cache... " cd $rerere if git branch --list rerere-cache | grep -q '\*' ; then - local rerere_remote=`branch_to_remote rerere-cache` + remote=`branch_to_remote rerere-cache` git pull >& /dev/null rm `rr_cache_dir`/rr-cache -Rf &> /dev/null || true
@@ -486,7 +497,7 @@ function dim_rebuild_tip echo -n "Nothing changed. " fi echo -n "Pushing rerere cache... " - git push $DRY_RUN $rerere_remote HEAD >& /dev/null && echo "Done." + git push $DRY_RUN $remote HEAD >& /dev/null && echo "Done." else echo "Fail: Branch setup for the rerere-cache is borked." exit 1
@@ -496,17 +507,19 @@ function dim_rebuild_tip # push. function dim_push_branch { + local branch remote + if [[ "x$1" = "x" ]]; then echo "usage: $dim $subcommand branch" exit 1 fi - local branch=$1 + branch=$1 shift assert_branch $branch - local remote=`branch_to_remote $branch` + remote=`branch_to_remote $branch` git push $DRY_RUN $remote $branch "$@"
@@ -540,20 +553,21 @@ dim_alias_ab=apply-branch dim_alias_sob=apply-branch function dim_apply_branch { - local branch=$1 + local branch file message_id commiter_email patch_from sob + + branch=$1 shift - local file=`mktemp` + file=`mktemp` assert_branch $branch assert_repo_clean cat > $file - local message_id=$(message_get_id $file) + message_id=$(message_get_id $file) - local commiter_email=$(git config --get user.email) - local patch_from=$(grep "From:" "$file" | head -1) - local sob + commiter_email=$(git config --get user.email) + patch_from=$(grep "From:" "$file" | head -1) if [[ "$patch_from" != *"$commiter_email"* ]] ; then sob=-s fi
@@ -591,7 +605,9 @@ function dim_apply_next_fixes function dim_cherry_pick { - local remote=`url_to_remote $drm_tip_ssh` + local remote sha sha_short + + remote=`url_to_remote $drm_tip_ssh` if [[ "x$1" = "x" ]]; then echo "usage: $dim $subcommand commit-ish"
@@ -692,11 +708,13 @@ function dim_apply_igt dim_alias_mp=magic-patch function dim_magic_patch { + local conflict_files + if [[ "$1" = "-a" ]]; then cd `cat ~/.dim-last-path` fi - local conflict_files=`patch -p1 | grep "saving rejects" | sed -e "s/.*saving rejects to file \(.*\)/\1/"` + conflict_files=`patch -p1 | grep "saving rejects" | sed -e "s/.*saving rejects to file \(.*\)/\1/"` if [[ $conflict_files != "" ]] ; then echo conflicts found!
@@ -712,12 +730,14 @@ function dim_magic_patch function dim_create_branch { + local branch repo remote + if [[ "x$1" = "x" ]]; then echo "usage: $dim $subcommand branch [commit-ish]" exit 1 fi - local branch=$1 - local repo="drm-intel" + branch=$1 + repo="drm-intel" if [[ "x$2" = "x" ]]; then start=HEAD
@@ -732,7 +752,7 @@ function dim_create_branch branch=${branch#*/} fi - local remote=`repo_to_remote $repo` + remote=`repo_to_remote $repo` $DRY git branch $branch $start git push $DRY_RUN $remote +$branch --set-upstream
@@ -746,11 +766,13 @@ function dim_create_branch function dim_remove_branch { + local branch repo remote + if [[ "x$1" = "x" ]]; then echo "usage: $dim $subcommand branch" exit 1 fi - local branch=$1 + branch=$1 cd $DIM_PREFIX/$DIM_DRM_INTEL
@@ -766,14 +788,14 @@ function dim_remove_branch cd $DIM_PREFIX/drm-tip - local repo=`branch_to_repo $branch` + repo=`branch_to_repo $branch` if [[ $repo == "" ]] ; then echoerr "$branch not found in $integration_config" exit 1 fi - local remote=`repo_to_remote $repo` + remote=`repo_to_remote $repo` git push $DRY_RUN $remote --delete $branch $DRY git fetch $remote --prune
@@ -801,15 +823,17 @@ function dim_cd dim_alias_co=checkout function dim_checkout { + local branch repo remote + if [[ "x$1" = "x" ]]; then echo "usage: $dim $subcommand branch" exit 1 fi - local branch=$1 + branch=$1 dim_cd $branch if [[ `git branch --list $branch` == "" ]] ; then - local repo=`branch_to_repo $branch` + repo=`branch_to_repo $branch` if [[ $branch == "drm-intel-next" ]] ; then repo="drm-intel"
@@ -820,7 +844,7 @@ function dim_checkout exit 1 fi - local remote=`repo_to_remote $repo` + remote=`repo_to_remote $repo` if [ "$remote" == "" ] ; then exit 1
@@ -850,19 +874,21 @@ function dim_conf # $1 is the git sha1 to check function checkpatch_commit { - local commit=$1 - local cmd="git show --pretty=email $commit" + local commit cmd bug_lines non_i915_files + + commit=$1 + cmd="git show --pretty=email $commit" git --no-pager log --oneline -1 $commit $cmd | scripts/checkpatch.pl -q --emacs --strict - || true - local bug_lines=$($cmd | grep -m 1 -B 1 '^\+.*\WBUG' | grep -c '^[+-].*\WBUG') + bug_lines=$($cmd | grep -m 1 -B 1 '^\+.*\WBUG' | grep -c '^[+-].*\WBUG') if test "$bug_lines" -eq 1; then warn_or_fail "New BUG macro added" fi if [ "$branch" = "drm-intel-next-queued" ]; then - local non_i915_files=$(git diff-tree --no-commit-id --name-only -r $commit | \ + non_i915_files=$(git diff-tree --no-commit-id --name-only -r $commit | \ grep -v "^\(drivers/gpu/drm/i915/\|include/drm/i915\|include/uapi/drm/i915\)") if [ -n "$non_i915_files" ]; then
@@ -889,7 +915,9 @@ dim_alias_check_patch=checkpatch dim_alias_cp=checkpatch function dim_checkpatch { - local range=$(rangeish "$1") + local range + + range=$(rangeish "$1") for commit in $(git rev-list --reverse $range); do checkpatch_commit $commit || true
@@ -898,7 +926,9 @@ function dim_checkpatch function dim_sparse { - local range=$(rangeish "$1") + local range + + range=$(rangeish "$1") make $DIM_MAKE_OPTIONS touch --no-create `git diff --name-only $range` `git diff --name-only`
@@ -941,11 +971,13 @@ function prep_pull_mail_signature # without tags, print a reminder function prep_pull_mail_overview { + local obj + if [ "$#" = "0" ]; then echo "*** insert pull request overview here ***" else for tag in $@ ; do - local obj=`git rev-parse $tag` + obj=`git rev-parse $tag` if [[ `git cat-file -t $obj` == "tag" ]] ; then echo $tag: git cat-file -p $obj | tail -n+6
@@ -965,9 +997,10 @@ function prep_pull_mail function dim_create_workdir { - cd $DIM_PREFIX local branches + cd $DIM_PREFIX + if [[ "x$1" = "x" ]]; then echo "usage: $dim $subcommand branch|all" exit 1
@@ -1011,9 +1044,11 @@ function dim_for_each_workdirs function dim_update_next { + local remote + assert_branch drm-intel-next-queued - local remote=`url_to_remote $drm_tip_ssh` + remote=`url_to_remote $drm_tip_ssh` git pull --ff-only
@@ -1044,9 +1079,11 @@ function dim_update_next function dim_update_next_continue { + local remote + assert_branch drm-intel-next-queued - local remote=`url_to_remote $drm_tip_ssh` + remote=`url_to_remote $drm_tip_ssh` git push $DRY_RUN -f $DIM_DRM_INTEL_REMOTE drm-intel-next-queued:drm-intel-next tag=drm-intel-next-$today
@@ -1105,14 +1142,16 @@ function dim_tag_next # dim_pull_request branch upstream function dim_pull_request { + local branch upstream remote repo url git_url + if [[ "x$1" = "x" || "x$2" = "x" ]]; then echo "usage: $dim $subcommand branch upstream" exit 1 fi - local branch=$1 - local upstream=$2 - local remote=`branch_to_remote $branch` + branch=$1 + upstream=$2 + remote=`branch_to_remote $branch` if [ "$branch" != "drm-intel-next" ]; then assert_branch $branch
@@ -1129,18 +1168,18 @@ function dim_pull_request prep_pull_mail $drm_intel_next_tags tag=`git describe --all --exact $branch@{upstream}` - local repo="drm-intel" + repo="drm-intel" else tag=$branch-$today $DRY git tag -f $tag $branch@{upstream} $DRY git push -f $remote $tag prep_pull_mail - local repo=`branch_to_repo $branch` + repo=`branch_to_repo $branch` fi - local url=${drm_tip_repos[$repo]} - local git_url=`echo $url | sed -e 's/git\./anongit./' -e 's/ssh:/git:/'` + url=${drm_tip_repos[$repo]} + git_url=`echo $url | sed -e 's/git\./anongit./' -e 's/ssh:/git:/'` git request-pull $upstream $git_url $tag >> ~/tmp/dim-pull-request $DRY $DIM_MUA -s "[PULL] $branch" \
@@ -1173,7 +1212,9 @@ function dim_pull_request_next_fixes # Note: used by bash completion function dim_list_upstreams { - local dim_drm_upstream_remote=`url_to_remote $drm_upstream_git` + local dim_drm_upstream_remote + + dim_drm_upstream_remote=`url_to_remote $drm_upstream_git` echo origin/master echo $dim_drm_upstream_remote/drm-next echo $dim_drm_upstream_remote/drm-fixes
@@ -1188,6 +1229,8 @@ function dim_list_branches dim_alias_ub=update-branches function dim_update_branches { + local repo remote + cd $DIM_PREFIX/$DIM_DRM_INTEL for remote in $DIM_DRM_INTEL_REMOTE `url_to_remote $drm_upstream_git` origin; do git fetch $remote
@@ -1197,8 +1240,8 @@ function dim_update_branches for branch in $dim_branches ; do dim_checkout $branch - local repo=`branch_to_repo $branch` - local remote=`repo_to_remote $repo` + repo=`branch_to_repo $branch` + remote=`repo_to_remote $repo` if git diff --quiet $remote/$branch; then $DRY git rebase
@@ -1214,10 +1257,11 @@ function dim_update_branches function setup_aux_checkout # name url directory { - local name=$1 - local url=$2 - local dir=$3 - local remote + local name url dir remote + + name=$1 + url=$2 + dir=$3 echo "Setting up $dir ..."
@@ -1297,7 +1341,9 @@ function dim_setup function assert_branch { - local branch=$1 + local branch + + branch=$1 dim_cd $branch
@@ -1339,12 +1385,14 @@ function dim_cat_to_fixup function dim_tc { + local tag dim_drm_upstream_remote + cd $DIM_PREFIX/$DIM_DRM_INTEL - local tag=$(git tag --contains $1 | grep ^v | sort -V | head -n 1) + tag=$(git tag --contains $1 | grep ^v | sort -V | head -n 1) if [[ -n "$tag" ]]; then echo "$tag" else - local dim_drm_upstream_remote=`url_to_remote $drm_upstream_git` + dim_drm_upstream_remote=`url_to_remote $drm_upstream_git` # not in a tagged release, show upstream branches git branch -r --contains $1 \ $DIM_DRM_INTEL_REMOTE/* \
@@ -1356,7 +1404,9 @@ function dim_tc function dim_cite { - local sha1=$1 + local sha1 + + sha1=$1 cd $DIM_PREFIX/$DIM_DRM_INTEL git log -1 $sha1 "--pretty=format:%H (\"%s\")%n" | \
@@ -1365,8 +1415,10 @@ function dim_cite function dim_fixes { + local sha1 tag + cd $DIM_PREFIX/$DIM_DRM_INTEL - local sha1=$1 + sha1=$1 echo "Fixes: $(dim_cite $sha1)"
@@ -1377,7 +1429,7 @@ function dim_fixes git show $sha1 | scripts/get_maintainer.pl --email --norolestats --pattern-depth 1 | sed -e "s/^/Cc: /" ) | awk '!x[$0]++' - local tag=$(git tag --contains $1 | grep ^v | sort -V | head -n 1) + tag=$(git tag --contains $1 | grep ^v | sort -V | head -n 1) if [[ -n "$tag" ]]; then if echo "$tag" | grep -q -e "-rc" ; then echo "Cc: <[email protected]> # ${tag}+"
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/7 dim: return exit status instead of actually exiting from url_to_remote
In reply to Jani NikulaThis lets us handle url_to_remote failures gracefully where they're not fatal.
--- dim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
dim +4 -2
@@ -205,7 +205,7 @@ function url_to_remote # url if [[ -z "$url" ]]; then echoerr "$0 without url" - exit 1 + return 1 fi remote=$(git remote -v | grep -m 1 "$url" | cut -f 1)
@@ -215,10 +215,12 @@ function url_to_remote # url echoerr "Please set it up using:" echoerr " $ git remote add <name> $url" echoerr "with a name of your choice." - exit 1 + return 1 fi echo $remote + + return 0 } function branch_to_remote # branch
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/7 dim: fix list-upstreams when not in a git repo or with a drm upstream in place
In reply to Jani Nikula'dim list-upstreams' is needed by bash completion and is used outside of git repos, also within git repos without drm upstream, so don't fail if it can be avoided.
--- dim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
dim +5 -1
@@ -1216,7 +1216,11 @@ function dim_list_upstreams { local dim_drm_upstream_remote - dim_drm_upstream_remote=`url_to_remote $drm_upstream_git` + # Handle failures gracefully + if ! dim_drm_upstream_remote=$(url_to_remote $drm_upstream_git 2>/dev/null); then + return 0 + fi + echo origin/master echo $dim_drm_upstream_remote/drm-next echo $dim_drm_upstream_remote/drm-fixes
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/7 dim: silence the fetch in dim fixes
In reply to Jani NikulaMesses up copy-pasting the output.
--- dim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
dim +1 -1
@@ -1443,7 +1443,7 @@ function dim_fixes echo "Cc: <[email protected]> # ${tag}+" fi else - git fetch $DIM_DRM_INTEL_REMOTE + git fetch $DIM_DRM_INTEL_REMOTE >/dev/null # Check whether it's already in a feature pile tag if git merge-base --is-ancestor $sha1 $DIM_DRM_INTEL_REMOTE/drm-intel-next ; then # Make sure we're in the critical window where we might
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [dim PATCH 6/7] dim: silence the fetch in dim fixes
Quoted 12 lines · Jani Nikula
Messes up copy-pasting the output.
Signed-off-by Jani Nikula <[email protected]>--- dim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)dim +0
-0
dim function dim_fixes · line 1446
Quoted 5 lines
dim +1
-1@@ -1443,7 +1443,7 @@ function dim_fixes echo "Cc: <[email protected]> # ${tag}+" fi else - git fetch $DIM_DRM_INTEL_REMOTE + git fetch $DIM_DRM_INTEL_REMOTE >/dev/null
Probably conflicts with my patch I just pushed to fix them all and switch to git fetch -q || true (|| true needed since git fetch has an exit value of 128 if there's nothing to fetch ...).
-Daniel
Quoted 10 lines
dim +0
-0# Check whether it's already in a feature pile tag if git merge-base --is-ancestor $sha1 $DIM_DRM_INTEL_REMOTE/drm-intel-next ; then # Make sure we're in the critical window where we mightSignature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/7 dim: check positional parameter on dim fixes and cite
In reply to Jani Nikula--- dim | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
dim +10 -1
@@ -1413,6 +1413,11 @@ function dim_cite local sha1 sha1=$1 + if [[ -z "$sha1" ]]; then + echoerr "usage: $dim $subcommand <commit-ish>" + return 1 + fi + cd $DIM_PREFIX/$DIM_DRM_INTEL git log -1 $sha1 "--pretty=format:%H (\"%s\")%n" | \
@@ -1423,9 +1428,13 @@ function dim_fixes { local sha1 tag - cd $DIM_PREFIX/$DIM_DRM_INTEL sha1=$1 + if [[ -z "$sha1" ]]; then + echoerr "usage: $dim $subcommand <commit-ish>" + return 1 + fi + cd $DIM_PREFIX/$DIM_DRM_INTEL echo "Fixes: $(dim_cite $sha1)" (
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx