configs  Check-in [5d30571be0]

Overview
Comment:zshrc: Add git2fl command to import Git -> Fossil
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 5d30571be08cd90727737f5ae96d192299adf9b78641a8ec3d27532fd0c4c834
User & Date: js on 2020-05-30 13:14:34
Other Links: manifest | tags
Context
2020-05-30
15:41
git2fl: Fix incremental import check-in: be955ae008 user: js tags: trunk
13:14
zshrc: Add git2fl command to import Git -> Fossil check-in: 5d30571be0 user: js tags: trunk
09:54
tmux.conf: Enable mouse mode check-in: 0c2853b29b user: js tags: trunk
Changes

Modified zshrc from [3cd7cd8b4c] to [22e0926828].

212
213
214
215
216
217
218































219
220
221
222
223
224
225
			red="$(tput setaf 1)"
			green="$(tput setaf 2)"
			reset="$(tput sgr0)"
			fossil diff -N "$@" | sed "s/^+.*$/$green&$reset/" |
				sed "s/^-.*$/$red&$reset/" | less -FRX
		fi
	}































fi

# pkgsrc does not like MAKEFLAGS including -j
which pkg_chk &>/dev/null && alias pkg_chk="MAKEFLAGS= pkg_chk"
which pkg_rolling-replace &>/dev/null &&
	alias pkg_rolling-replace="MAKEFLAGS= pkg_rolling-replace"
which url2pkg &>/dev/null && alias url2pkg="MAKEFLAGS= url2pkg"







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
			red="$(tput setaf 1)"
			green="$(tput setaf 2)"
			reset="$(tput sgr0)"
			fossil diff -N "$@" | sed "s/^+.*$/$green&$reset/" |
				sed "s/^-.*$/$red&$reset/" | less -FRX
		fi
	}

	git2fl() {
		local gitdir=$(git rev-parse --show-toplevel)/.git
		local repo=$(fossil info | awk '/^repository:/ { print $2 }')

		[ -z "$repo" ] && repo="$1"

		[ -n "$repo" -a -f "$repo" ] &&
			local incremental="--incremental"

		[ -d "$gitdir/git.marks" ] &&
			local importmarks_git="--import-marks=$gitdir/git.marks"

		if [ -d "$gitdir/fossil.marks" ]; then
			local importmarks_fossil
			importmarks_fossil="--import-marks $gitdir/fossil.marks"
		fi

		LC_ALL=C git fast-export			\
			--signed-tags=warn-strip		\
			--export-marks=$gitdir/git.marks	\
			$=importmarks_git			\
			--all |
		LC_ALL=C fossil import				\
			--git					\
			$=incremental				\
			--rename-master trunk			\
			--export-marks $gitdir/fossil.marks	\
			$=importmarks_fossil			\
			$repo
	}
fi

# pkgsrc does not like MAKEFLAGS including -j
which pkg_chk &>/dev/null && alias pkg_chk="MAKEFLAGS= pkg_chk"
which pkg_rolling-replace &>/dev/null &&
	alias pkg_rolling-replace="MAKEFLAGS= pkg_rolling-replace"
which url2pkg &>/dev/null && alias url2pkg="MAKEFLAGS= url2pkg"