git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/4] Add 2 new contrib scripts.

From
Yann Dirson <ydirson@altern.org>
Date
May 31, 2007, 22:34 UTC
Message-ID
<20070531223423.6005.59088.stgit@gandelf.nowhere.earth>
In-Reply-To
<20070531222920.6005.74481.stgit@gandelf.nowhere.earth>
Signed-off-by: Yann Dirson <ydirson@altern.org>
---
 contrib/stg-k     |   32 ++++++++++++++++++++++++++++++++
 contrib/stg-unnew |   15 +++++++++++++++
 2 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/contrib/stg-k b/contrib/stg-k
new file mode 100755
index 0000000..0134c25
--- /dev/null
+++ b/contrib/stg-k
@@ -0,0 +1,32 @@
+#!/bin/sh
+set -e
+
+# stg-k - execute given StGIT command while preserving local changes
+
+# Uses a temporary patch to save local changes, then execute the given
+# command, and restore local changes from the saved patch.  In
+# essence, "stg-k pop" is a "stg pop -k" that works better, hence its
+# name.
+
+# CAVEAT: this script relies on the operation to run ignoring hidden
+# patches, so in 0.12 (where "stg push" can push an hidden patch)
+# "stg-k push" will fail midway, albeit with no information loss -
+# you'll just have to finish manually.  Luckilly this appears to work
+# on master branch.
+
+# Copyright (c) 2007 Yann Dirson <ydirson@altern.org>
+# Subject to the GNU GPL, version 2.
+
+stg new __local -m " - local changes (internal patch)"
+stg refresh
+stg pop
+
+# avoid bad interactions like "stg-k push" not behaving as expected
+stg hide __local
+
+stg "$@"
+
+stg unhide __local
+
+stg push __local
+stg-unnew
diff --git a/contrib/stg-unnew b/contrib/stg-unnew
new file mode 100755
index 0000000..5ac8781
--- /dev/null
+++ b/contrib/stg-unnew
@@ -0,0 +1,15 @@
+#!/bin/sh
+set -e
+
+# stg-unnew - sort of "reverse an 'stg new'"
+
+# Remove the current patch from the stack, keeping its contents as
+# uncommitted changes.
+
+# Copyright (c) 2007 Yann Dirson <ydirson@altern.org>
+# Subject to the GNU GPL, version 2.
+
+patch=$(stg top)
+stg pop
+stg pick --fold $patch
+stg delete $patch
Previous: Yann DirsonNext: David Kågedal
Message 2 of 10 in “Rename detection, take 2”
  1. 0/4 Rename detection, take 2Yann Dirson, May 31, 2007
  2. 1/4 Add 2 new contrib scripts.Yann Dirson, May 31, 2007
  3. David KågedalJun 1, 2007
  4. Karl HasselströmJun 3, 2007
  5. Yann DirsonJun 3, 2007
  6. 2/4 Call external commands without a shell where possible.Yann Dirson, May 31, 2007
  7. 3/4 Make diff flags handling more modular.Yann Dirson, May 31, 2007
  8. 4/4 Add new --diff-opts/-O flag to diff- and status-related commands.Yann Dirson, May 31, 2007
  9. Catalin MarinasJun 4, 2007
  10. Yann DirsonJun 5, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.