[StGit PATCH] contrib/vim: Fix filetype detection in VIM >=7.4

2016-07-15 Thread Zane Bitter
The command "setfiletype" will not override an existing filetype. This was
never a problem for me previously, but since upgrading from VIM 7.3 to 7.4
the filetype for StGit's files is explicitly set to "text", preventing the
stgit ftdetect plugin overriding it. Use "setlocal filetype=" instead to
ensure that we override any previously detected filetype.

Signed-off-by: Zane Bitter <zbit...@redhat.com>
---
 contrib/vim/ftdetect/stg.vim |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/contrib/vim/ftdetect/stg.vim b/contrib/vim/ftdetect/stg.vim
index abd4d9f..adf46dd 100644
--- a/contrib/vim/ftdetect/stg.vim
+++ b/contrib/vim/ftdetect/stg.vim
@@ -6,23 +6,22 @@
 if has("autocmd")
 
   " Detect 'stg new' files
-  autocmd BufNewFile,BufRead .stgit-new.txt   setf stgnew
-  autocmd BufNewFile,BufRead .stgitmsg.txtsetf stgnew
+  autocmd BufNewFile,BufRead .stgit-new.txt   setlocal filetype=stgnew
+  autocmd BufNewFile,BufRead .stgitmsg.txtsetlocal filetype=stgnew
   " Ignore the modeline so we get type 'stgnew' instead of 'diff'
   autocmd BufNewFile,BufRead .stgitmsg.txtsetlocal nomodeline
 
   " Detect 'stg edit' files
-  autocmd BufNewFile,BufRead .stgit-edit.txt  setf stgedit
-  " Use set filetype instead of setfiletype to override detection as patch
+  autocmd BufNewFile,BufRead .stgit-edit.txt  setlocal filetype=stgedit
   autocmd BufNewFile,BufRead .stgit-edit.patchsetlocal filetype=stgedit
   autocmd BufNewFile,BufRead .stgit-edit.diff setlocal filetype=stgedit
   autocmd BufNewFile,BufRead .stgit-failed.patch  setlocal filetype=stgedit
 
   " Detect 'stg squash' files
-  autocmd BufNewFile,BufRead .stgit-squash.txtsetf stgsquash
+  autocmd BufNewFile,BufRead .stgit-squash.txtsetlocal filetype=stgsquash
 
   " Detect 'stg mail' files
-  autocmd BufNewFile,BufRead .stgitmail.txt   setf stgmail
+  autocmd BufNewFile,BufRead .stgitmail.txt   setlocal filetype=stgmail
 
 
   " A modeline in a diff belongs to the diffed file, so ignore it

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[StGit PATCH] Fix dirty index errors when resolving conflicts

2013-07-17 Thread Zane Bitter
The patch 6e8fdc58c786a45d7a63c5edf9c702f1874a7a19 causes StGit to raise
warnings (actually: errors) in the event that there are changes staged in
the index and a refresh is performed without specifying either --index or
--force. This is great for preventing an entire class of common mistakes,
but is also a giant pain when resolving conflicts after a pull/rebase.
Depending on the workflow in use, this may occur with a frequency anywhere
between never and mulitple times on every pull.

This patch removes the pain by:
 - Reporting unresolved conflicts *before* complaining about staged
   changes, since it goes without saying that, when present, these are the
   main problem.
 - Not complaining about staged changes if there are no unstaged changes in
   the working directory, since the presence of --index is immaterial in
   this case.

Signed-off-by: Zane Bitter zbit...@redhat.com
---
 stgit/commands/refresh.py |   13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/stgit/commands/refresh.py b/stgit/commands/refresh.py
index a2bab42..331c18d 100644
--- a/stgit/commands/refresh.py
+++ b/stgit/commands/refresh.py
@@ -247,18 +247,19 @@ def func(parser, options, args):
 patch_name = get_patch(stack, options.patch)
 paths = list_files(stack, patch_name, args, options.index, options.update)
 
-# Make sure the index is clean before performing a full refresh
-if not options.index and not options.force:
-if not stack.repository.default_index.is_clean(stack.head):
-raise common.CmdException(
-'The index is dirty. Did you mean --index? To force a full 
refresh use --force.')
-
 # Make sure there are no conflicts in the files we want to
 # refresh.
 if stack.repository.default_index.conflicts()  paths:
 raise common.CmdException(
 'Cannot refresh -- resolve conflicts first')
 
+# Make sure the index is clean before performing a full refresh
+if not options.index and not options.force:
+if not (stack.repository.default_index.is_clean(stack.head) or
+stack.repository.default_iw.worktree_clean()):
+raise common.CmdException(
+'The index is dirty. Did you mean --index? To force a full 
refresh use --force.')
+
 # Commit index to temp patch, and absorb it into the target patch.
 retval, temp_name = make_temp_patch(
 stack, patch_name, paths, temp_index = path_limiting)

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[StGit PATCH] Include emacs and vim contribs in source tarball

2012-11-29 Thread Zane Bitter
This will enable downstream distros to package them.

Signed-off-by: Zane Bitter zbit...@redhat.com
---
 MANIFEST.in |3 +++
 1 file changed, 3 insertions(+)

diff --git a/MANIFEST.in b/MANIFEST.in
index c94eef6..a80f013 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -9,6 +9,9 @@ include examples/gitconfig
 include contrib/*.sh
 include contrib/*.bash
 include contrib/stg-*
+include contrib/Makefile
+include contrib/stgit.el
+recursive-include contrib/vim *.vim
 include t/t*.sh t/t*/* t/Makefile t/README
 include Documentation/*.txt Documentation/Makefile Documentation/*.conf
 include Documentation/build-docdep.perl Documentation/callouts.xsl

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html