summaryrefslogtreecommitdiff
path: root/Documentation/git-stash.txt
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'ab/doc-synopsis-and-cmd-usage'Junio C Hamano2022-10-281-7/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The short-help text shown by "git cmd -h" and the synopsis text shown at the beginning of "git help cmd" have been made more consistent. * ab/doc-synopsis-and-cmd-usage: (34 commits) tests: assert consistent whitespace in -h output tests: start asserting that *.txt SYNOPSIS matches -h output doc txt & -h consistency: make "worktree" consistent worktree: define subcommand -h in terms of command -h reflog doc: list real subcommands up-front doc txt & -h consistency: make "commit" consistent doc txt & -h consistency: make "diff-tree" consistent doc txt & -h consistency: use "[<label>...]" for "zero or more" doc txt & -h consistency: make "annotate" consistent doc txt & -h consistency: make "stash" consistent doc txt & -h consistency: add missing options doc txt & -h consistency: use "git foo" form, not "git-foo" doc txt & -h consistency: make "bundle" consistent doc txt & -h consistency: make "read-tree" consistent doc txt & -h consistency: make "rerere" consistent doc txt & -h consistency: add missing options and labels doc txt & -h consistency: make output order consistent doc txt & -h consistency: add or fix optional "--" syntax doc txt & -h consistency: fix mismatching labels doc SYNOPSIS & -h: use "-" to separate words in labels, not "_" ...
| * doc txt & -h consistency: make "stash" consistentÆvar Arnfjörð Bjarmason2022-10-131-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Amend both the -h output and *.txt to match one another. In this case the *.txt didn't list the "save" subcommand, and the "-h" was similarly missing some commands. Let's also convert the *.c code to use a macro definition, similar to that used in preceding commits. This avoids duplication. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * stash doc SYNOPSIS & -h: correct padding around "[]()"Ævar Arnfjörð Bjarmason2022-10-131-6/+6
| | | | | | | | | | | | | | | | | | | | The whitespace padding of alternatives should be of the form "[-f | --force]" not "[-f|--force]". Likewise we should not have padding before the first option, so "(--all | <pack-filename>...)" is correct, not "( --all | <pack-filename>... )". Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * doc txt & -h consistency: fix incorrect alternates syntaxÆvar Arnfjörð Bjarmason2022-10-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the incorrect "[-o | --option <argument>]" syntax, which should be "[(-o | --option) <argument>]", we were previously claiming that only the long option accepted the "<argument>", which isn't what we meant. This syntax issue for "bugreport" originated in 238b439d698 (bugreport: add tool to generate debugging info, 2020-04-16), and for "diagnose" in 6783fd3cef0 (builtin/diagnose.c: create 'git diagnose' builtin, 2022-08-12), which copied and adjusted "bugreport" documentation and code. In the case of "Documentation/git-stash.txt" and "builtin/stash.c" this is not a "doc txt & -h consistency" change, as we're changing both versions, doing so here makes a subsequent change smaller. In that case fix the incorrect "[-o | --option <argument>]" syntax, which should be "[(-o | --option) <argument>]", we were previously claiming that only the long option accepted the "<argument>", which isn't what we meant. The "stash" issue has been with us in both the "-h" and *.txt versions since bd514cada4b (stash: introduce 'git stash store', 2013-06-15). We could claim that this isn't a syntax issue if a "vertical bar binds tighter than option and its argument", but such a rule would change e.g. this "cat-file" SYNOPSIS example to mean something we don't: ... [<rev>:<path|tree-ish> | --path=<path|tree-ish> <rev>] We have various other examples where the post-image here is already used, e.g. for "format-patch" ("-o"), "grep" ("-m"), "submodule" ("set-branch -b") etc. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | docs: add CONFIGURATION sections that map to a built-inÆvar Arnfjörð Bjarmason2022-09-071-0/+7
|/ | | | | | | | | | | Add a CONFIGURATION section to the documentation of various built-ins, for those cases where the relevant config/NAME.txt describes configuration that is only used by the relevant built-in documented in git-NAME.txt. Subsequent commits will handle more complex cases. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Reviewed-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* stash: implement '--staged' option for 'push' and 'save'Sergey Organov2021-10-181-3/+31
| | | | | | | | | | | | | | Stash only the changes that are staged. This mode allows to easily stash-out for later reuse some changes unrelated to the current work in progress. Unlike 'stash push --patch', --staged supports use of any tool to select the changes to stash-out, including, but not limited to 'git add --interactive'. Signed-off-by: Sergey Organov <sorganov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* stash show: use stash.showIncludeUntracked even when diff options givenDenton Liu2021-05-221-2/+4
| | | | | | | | | | | | | | | | | If options pertaining to how the diff is displayed is provided to `git stash show`, the command will ignore the stash.showIncludeUntracked configuration variable, defaulting to not showing any untracked files. This is unintuitive behaviour since the format of the diff output and whether or not to display untracked files are orthogonal. Use stash.showIncludeUntracked even when diff options are given. Of course, this is still overridable via the command-line options. Update the documentation to explicitly say which configuration variables will be overridden when a diff options are given. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* stash show: learn stash.showIncludeUntrackedDenton Liu2021-03-051-2/+2
| | | | | | | | | | | The previous commit teaches `git stash show --include-untracked`. It may be desirable for a user to be able to always enable the --include-untracked behavior. Teach the stash.showIncludeUntracked config option which allows users to do this in a similar manner to stash.showPatch. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* stash show: teach --include-untracked and --only-untrackedDenton Liu2021-03-051-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | Stash entries can be made with untracked files via `git stash push --include-untracked`. However, because the untracked files are stored in the third parent of the stash entry and not the stash entry itself, running `git stash show` does not include the untracked files as part of the diff. With --include-untracked, untracked paths, which are recorded in the third-parent if it exists, are shown in addition to the paths that have modifications between the stash base and the working tree in the stash. It is possible to manually craft a malformed stash entry where duplicate untracked files in the stash entry will mask tracked files. We detect and error out in that case via a custom unpack_trees() callback: stash_worktree_untracked_merge(). Also, teach stash the --only-untracked option which only shows the untracked files of a stash entry. This is similar to `git show stash^3` but it is nice to provide a convenient abstraction for it so that users do not have to think about the underlying implementation. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-stash.txt: be explicit about subcommand optionsDenton Liu2021-02-111-4/+4
| | | | | | | | | | | | | | Currently, the options for the `list` and `show` subcommands are just listed as `<options>`. This seems to imply, from a cursory glance at the summary, that they take the stash options listed below. However, reading more carefully, we see that they take log options and diff options respectively. Make it more obvious that they take log and diff options by explicitly stating this in the subcommand summary. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* stash push: support the --pathspec-from-file optionAlexandr Miloslavskiy2020-02-191-1/+19
| | | | | | | | | | | Decisions taken for simplicity: 1) For now, `--pathspec-from-file` is declared incompatible with `--patch`, even when <file> is not `-`. Such use case is not really expected. 2) It is not allowed to pass pathspec in both args and file. Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* doc: stash: synchronize <pathspec> descriptionAlexandr Miloslavskiy2020-02-191-2/+4
| | | | | | | | | | | This patch continues the effort that is already applied to `git commit`, `git reset`, `git checkout` etc. 1) Added reference to 'linkgit:gitglossary[7]'. 2) Fixed mentions of incorrectly plural "pathspecs". Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* doc: stash: document more optionsAlexandr Miloslavskiy2020-02-191-0/+12
| | | | | Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* doc: stash: split options from description (2)Alexandr Miloslavskiy2020-02-191-35/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Together with the previous patch, this brings docs for `git stash` to the common layout used for most other commands (see for example docs for `git add`, `git commit`, `git checkout`, `git reset`) where all options are documented in a separate list. After some thinking and having a look at docs for `git svn` and `git `submodule`, I have arrived at following conclusions: * Options should be described in a list rather then text to facilitate lookup for user. * Single list is better then multiple lists because it avoids copy&pasting descriptions between subcommands (or, without copy&pasting, user will have to look up missing options in other subcommands). * As a consequence, commands section should only give brief info and list possible options. Since options have good enough names, user will only need to look up the "interesting" options. * Every option should list which subcommands support it. I have decided to use alphabetical sorting in the list of options to facilitate lookup for user. There is some text editing done to make old descriptions better fit into the list-style format. Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* doc: stash: split options from description (1)Alexandr Miloslavskiy2020-02-191-33/+35
| | | | | | | | This patch moves blocks of text as-is to make it easier to review the next patch. Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* doc(stash): clarify the description of `save`Johannes Schindelin2019-10-111-2/+3
| | | | | | | | | | | | | The original phrasing of this paragraph made at least one person stumble over the word "from" (thinking that it was a typo and "from" was intended), and other readers chimed in, agreeing that it was confusing: https://public-inbox.org/git/0102016b8d597569-c1f6cfdc-cb45-4428-8737-cb1bc30655d8-000000@eu-west-1.amazonses.com/#t Let's rewrite that paragraph for clarity. Inspired-by-a-patch-by: Catalin Criste <cris_linu_w@yahoo.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'nd/switch-and-restore'Junio C Hamano2019-07-091-4/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two new commands "git switch" and "git restore" are introduced to split "checking out a branch to work on advancing its history" and "checking out paths out of the index and/or a tree-ish to work on advancing the current history" out of the single "git checkout" command. * nd/switch-and-restore: (46 commits) completion: disable dwim on "git switch -d" switch: allow to switch in the middle of bisect t2027: use test_must_be_empty Declare both git-switch and git-restore experimental help: move git-diff and git-reset to different groups doc: promote "git restore" user-manual.txt: prefer 'merge --abort' over 'reset --hard' completion: support restore t: add tests for restore restore: support --patch restore: replace --force with --ignore-unmerged restore: default to --source=HEAD when only --staged is specified restore: reject invalid combinations with --staged restore: add --worktree and --staged checkout: factor out worktree checkout code restore: disable overlay mode by default restore: make pathspec mandatory restore: take tree-ish from --source option instead checkout: split part of it to new command 'restore' doc: promote "git switch" ...
| * doc: promote "git switch"Nguyễn Thái Ngọc Duy2019-04-021-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new command "git switch" is added to avoid the confusion of one-command-do-all "git checkout" for new users. They are also helpful to avoid ambiguation context. For these reasons, promote it everywhere possible. This includes documentation, suggestions/advice from other commands... The "Checking out files" progress line in unpack-trees.c is also updated to "Updating files" to be neutral to both git-checkout and git-switch. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | stash: mention options in `show` synopsisPaul-Sebastian Ungureanu2019-03-071-2/+2
|/ | | | | | | | | Mention in the documentation, that `show` accepts any option known to `git diff`. Signed-off-by: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com> Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-stash.txt: remove extra square brackettg/stash-doc-typofixThomas Gummerer2018-03-271-1/+1
| | | | | | | | | | | | | | | | | | | In 1ada5020b3 ("stash: use stash_push for no verb form", 2017-02-28), when the pathspec argument was introduced in 'git stash', that was also documented. However I forgot to remove an extra square bracket after the '--message' argument, even though the square bracket should have been after the pathspec argument (where it was also added). Remove the extra square bracket after the '--message' argument, to show that the pathspec argument should be used with the 'push' verb. While the pathspec argument can be used without the push verb, that's a special case described later in the man page, and removing the first extra square bracket instead of the second one makes the synopis easier to understand. Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* doc: prefer 'stash push' over 'stash save'tg/deprecate-stash-savePhil Hord2017-11-221-2/+2
| | | | | | | | | Although `git stash save` was deprecated recently, some parts of the documentation still refer to it instead of `push`. Signed-off-by: Phil Hord <phil.hord@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* stash: mark "git stash save" deprecated in the man pageThomas Gummerer2017-10-271-3/+6
| | | | | | | | | | | | | 'git stash push' fixes a historical wart in the interface of 'git stash save'. As 'git stash push' has all functionality of 'git stash save', with a nicer, more consistent user interface deprecate 'git stash save'. To do this, remove it from the synopsis of the man page, and move it to a separate section, stating that it is deprecated. Helped-by: Robert P. J. Day <rpjday@crashcourse.ca> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* stash: replace "git stash save" with "git stash push" in the documentationThomas Gummerer2017-10-271-6/+6
| | | | | | | | | | | "git stash push" is the newer interface for creating a stash. While we are still keeping "git stash save" around for the time being, it's better to point new users of "git stash" to the more modern (and more feature rich) interface, instead of teaching them the older version that we might want to phase out in the future. Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* stash: update documentation to use 'stash entry'Liam Beguin2017-06-181-29/+31
| | | | | | | | Most of the time, a 'stash entry' is called a 'stash'. Lets try to make this more consistent and use 'stash entry' instead. Signed-off-by: Liam Beguin <liambeguin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* stash: allow pathspecs in the no verb formtg/stash-pushThomas Gummerer2017-02-281-4/+7
| | | | | | | | | | | | Now that stash_push is used in the no verb form of stash, allow specifying the command line for this form as well. Always use -- to disambiguate pathspecs from other non-option arguments. Also make git stash -p an alias for git stash push -p. This allows users to use git stash -p <pathspec>. Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* stash: use stash_push for no verb formThomas Gummerer2017-02-281-4/+4
| | | | | | | | | | | | | | Now that we have stash_push, which accepts pathspec arguments, use it instead of stash_save in git stash without any additional verbs. Previously we allowed git stash -- -message, which is no longer allowed after this patch. Messages starting with a hyphen was allowed since 3c2eb80f, ("stash: simplify defaulting to "save" and reject unknown options"). However it was never the intent to allow that, but rather it was allowed accidentally. Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* stash: teach 'push' (and 'create_stash') to honor pathspecThomas Gummerer2017-02-281-1/+8
| | | | | | | | | | | | | | While working on a repository, it's often helpful to stash the changes of a single or multiple files, and leave others alone. Unfortunately git currently offers no such option. git stash -p can be used to work around this, but it's often impractical when there are a lot of changes over multiple files. Allow 'git stash push' to take pathspec to specify which paths to stash. Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* stash: introduce push verbThomas Gummerer2017-02-191-0/+3
| | | | | | | | | | | | | | | Introduce a new git stash push verb in addition to git stash save. The push verb is used to transition from the current command line arguments to a more conventional way, in which the message is given as an argument to the -m option. This allows us to have pathspecs at the end of the command line arguments like other Git commands do, so that the user can say which subset of paths to stash (and leave others behind). Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Documentation/stash: remove mention of git reset --hardtg/stash-doc-cleanupThomas Gummerer2017-02-131-2/+3
| | | | | | | | | | | Don't mention git reset --hard in the documentation for git stash save. It's an implementation detail that doesn't matter to the end user and thus shouldn't be exposed to them. In addition it's not quite true for git stash -p, and will not be true when a filename argument to limit the stash to a few files is introduced. Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* stash: allow stashes to be referenced by index onlyaw/numbered-stashAaron M Watson2016-10-261-1/+2
| | | | | | | | | | | | | | | | | | | Instead of referencing "stash@{n}" explicitly, make it possible to simply reference as "n". Most users only reference stashes by their position in the stash stack (what I refer to as the "index" here). The syntax for the typical stash (stash@{n}) is slightly annoying and easy to forget, and sometimes difficult to escape properly in a script. Because of this the capability to do things with the stash by simply referencing the index is desirable. This patch includes the superior implementation provided by Øsse Walle (thanks for that), with a slight change to fix a broken test in the test suite. I also merged the test scripts as suggested by Jeff King, and un-wrapped the documentation as suggested by Junio Hamano. Signed-off-by: Aaron M Watson <watsona4@gmail.com> Reviewed-by: Jeff King <peff@peff.net>
* stash: allow "stash show" diff output configurablenk/stash-show-configNamhyung Kim2015-08-311-0/+2
| | | | | | | | | | | | | | | Some users might want to see diff (patch) output always rather than diffstat when [s]he runs 'git stash show'. Although this can be done with adding -p option, users are too lazy to type extra three keys. Add two variables that control to show diffstat and patch output respectively. The stash.showStat is for diffstat and default is true. The stat.showPatch is for the patch output and default is false. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* stash doc: mention short form -k in save descriptionjm/stash-doc-k-for-keepJohn Marshall2014-02-241-1/+1
| | | | | | | | Document --keep-index's short form -k in both main synopsis and the save synopsis in the Options section. Signed-off-by: John Marshall <jm18@sanger.ac.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Revert "git stash: avoid data loss when "git stash save" kills a directory"Junio C Hamano2013-08-141-10/+2
| | | | | | | | | | This reverts commit a73653130edd6a8977106d45a8092c09040f9132, as it has been reported that "ls-files --killed" is too time-consuming in a deep directory with too many untracked crufts (e.g. $HOME/.git tracking only a few files). We'd need to revisit it later but "ls-files --killed" needs to be optimized before it happens.
* git stash: avoid data loss when "git stash save" kills a directoryPetr Baudis2013-07-011-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | "stash save" is about saving the local change to the working tree, but also about restoring the state of the last commit to the working tree. When a local change is to turn a non-directory to a directory, in order to restore the non-directory, everything in the directory needs to be removed. Which is fine when running "git stash save --include-untracked", but without that option, untracked, newly created files in the directory will have to be discarded, if the state you are restoring to has a non-directory at the same path as the directory. Introduce a safety valve to fail the operation in such case, using the "ls-files --killed" which was designed for this exact purpose. The "stash save" is stopped when untracked files need to be discarded because their leading path ceased to be a directory, and the user is required to pass --force to really have the data removed. Signed-off-by: Petr Baudis <pasky@ucw.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* stash: introduce 'git stash store'Ramkumar Ramachandra2013-06-171-0/+7
| | | | | | | | | | | | | | | | | save_stash() contains the logic for doing two potentially independent operations; the first is preparing the stash merge commit, and the second is updating the stash ref/ reflog accordingly. While the first operation is abstracted out into a create_stash() for callers to access via 'git stash create', the second one is not. Fix this by factoring out the logic for storing the stash into a store_stash() that callers can access via 'git stash store'. Like create, store is not intended for end user interactive use, but for callers in other scripts. We can simplify the logic in the rebase.autostash feature using this new subcommand. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* stash doc: document short form -p in synopsisRamkumar Ramachandra2013-06-171-1/+1
| | | | | | | | 'git stash save' can take -p, the short form of --patch, as an option. Document this. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* stash doc: add a warning about using createRamkumar Ramachandra2013-06-171-1/+3
| | | | | | | | | Add a note saying that the user probably wants "save" in the create description. While at it, document that it can optionally take a message in the synopsis. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Documentation/git-stash.txt: add a missing verbSébastien Loriot2012-12-101-1/+1
| | | | | Signed-off-by: Sébastien Loriot <sloriot.ml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* docs: stop using asciidoc no-inline-literalJeff King2012-04-261-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In asciidoc 7, backticks like `foo` produced a typographic effect, but did not otherwise affect the syntax. In asciidoc 8, backticks introduce an "inline literal" inside which markup is not interpreted. To keep compatibility with existing documents, asciidoc 8 has a "no-inline-literal" attribute to keep the old behavior. We enabled this so that the documentation could be built on either version. It has been several years now, and asciidoc 7 is no longer in wide use. We can now decide whether or not we want inline literals on their own merits, which are: 1. The source is much easier to read when the literal contains punctuation. You can use `master~1` instead of `master{tilde}1`. 2. They are less error-prone. Because of point (1), we tend to make mistakes and forget the extra layer of quoting. This patch removes the no-inline-literal attribute from the Makefile and converts every use of backticks in the documentation to an inline literal (they must be cleaned up, or the example above would literally show "{tilde}" in the output). Problematic sites were found by grepping for '`.*[{\\]' and examined and fixed manually. The results were then verified by comparing the output of "html2text" on the set of generated html pages. Doing so revealed that in addition to making the source more readable, this patch fixes several formatting bugs: - HTML rendering used the ellipsis character instead of literal "..." in code examples (like "git log A...B") - some code examples used the right-arrow character instead of '->' because they failed to quote - api-config.txt did not quote tilde, and the resulting HTML contained a bogus snippet like: <tt><sub></tt> foo <tt></sub>bar</tt> which caused some parsers to choke and omit whole sections of the page. - git-commit.txt confused ``foo`` (backticks inside a literal) with ``foo'' (matched double-quotes) - mentions of `A U Thor <author@example.com>` used to erroneously auto-generate a mailto footnote for author@example.com - the description of --word-diff=plain incorrectly showed the output as "[-removed-] and {added}", not "{+added+}". - using "prime" notation like: commit `C` and its replacement `C'` confused asciidoc into thinking that everything between the first backtick and the final apostrophe were meant to be inside matched quotes - asciidoc got confused by the escaping of some of our asterisks. In particular, `credential.\*` and `credential.<url>.\*` properly escaped the asterisk in the first case, but literally passed through the backslash in the second case. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* stash: Add --include-untracked option to stash and remove all untracked filesDavid Caldwell2011-06-261-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | The --include-untracked option acts like the normal "git stash save" but also adds all untracked files in the working directory to the stash and then calls "git clean --force --quiet" to restore the working directory to a pristine state. This is useful for projects that need to run release scripts. With this option, the release scripts can be from the main working directory so one does not have to maintain a "clean" directory in parallel just for releasing. Basically the work-flow becomes: $ git tag release-1.0 $ git stash --include-untracked $ make release $ git clean -f $ git stash pop "git stash" alone is not enough in this case--it leaves untracked files lying around that might mess up a release process that expects everything to be very clean or might let a release succeed that should actually fail (due to a new source file being created that hasn't been committed yet). Signed-off-by: David Caldwell <david@porkrind.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-stash.txt: better docs for '--patch'Valentin Haenel2011-05-051-4/+5
| | | | | | | | | | Describe '-p' as a short form of '--patch' in synopsis and options. Also refer the reader to the patch mode description of git-add documentation. Helped-by: Jeff King <peff@peff.net> Mentored-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Valentin Haenel <valentin.haenel@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* doc: drop author/documentation sections from most pagesJeff King2011-03-111-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The point of these sections is generally to: 1. Give credit where it is due. 2. Give the reader an idea of where to ask questions or file bug reports. But they don't do a good job of either case. For (1), they are out of date and incomplete. A much more accurate answer can be gotten through shortlog or blame. For (2), the correct contact point is generally git@vger, and even if you wanted to cc the contact point, the out-of-date and incomplete fields mean you're likely sending to somebody useless. So let's drop the fields entirely from all manpages except git(1) itself. We already point people to the mailing list for bug reports there, and we can update the Authors section to give credit to the major contributors and point to shortlog and blame for more information. Each page has a "This is part of git" footer, so people can follow that to the main git manpage.
* detached-stash: update DocumentationJon Seymour2010-08-211-5/+11
| | | | | | | | | | | Update the documentation to indicate that git stash branch only attempts to drop the specified stash if it looks like stash reference. Also changed the synopsis to more clearly indicate which commands require a stash entry reference as opposed to merely a stash-like commit. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* docs: don't talk about $GIT_DIR/refs/ everywhereJeff King2010-02-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It is misleading to say that we pull refs from $GIT_DIR/refs/*, because we may also consult the packed refs mechanism. These days we tend to treat the "refs hierarchy" as more of an abstract namespace that happens to be represented as $GIT_DIR/refs. At best, this is a minor inaccuracy, but at worst it can confuse users who then look in $GIT_DIR/refs and find that it is missing some of the refs they expected to see. This patch drops most uses of "$GIT_DIR/refs/*", changing them into just "refs/*", under the assumption that users can handle the concept of an abstract refs namespace. There are a few things to note: - most cases just dropped the $GIT_DIR/ portion. But for cases where that left _just_ the word "refs", I changed it to "refs/" to help indicate that it was a hierarchy. I didn't do the same for longer paths (e.g., "refs/heads" remained, instead of becoming "refs/heads/"). - in some cases, no change was made, as the text was explicitly about unpacked refs (e.g., the discussion in git-pack-refs). - In some cases it made sense instead to note the existence of packed refs (e.g., in check-ref-format and rev-parse). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Documentation: spell 'git cmd' without dash throughoutThomas Rast2010-01-101-3/+3
| | | | | | | | | | | | | | | The documentation was quite inconsistent when spelling 'git cmd' if it only refers to the program, not to some specific invocation syntax: both 'git-cmd' and 'git cmd' spellings exist. The current trend goes towards dashless forms, and there is precedent in 647ac70 (git-svn.txt: stop using dash-form of commands., 2009-07-07) to actively eliminate the dashed variants. Replace 'git-cmd' with 'git cmd' throughout, except where git-shell, git-cvsserver, git-upload-pack, git-receive-pack, and git-upload-archive are concerned, because those really live in the $PATH.
* Documentation: format full commands in typewriter fontThomas Rast2010-01-101-1/+1
| | | | | | | | | | | | | | Use `code snippet` style instead of 'emphasis' for `git cmd ...` according to the following rules: * The SYNOPSIS sections are left untouched. * If the intent is that the user type the command exactly as given, it is `code`. If the user is only loosely referred to a command and/or option, it remains 'emphasised'. Signed-off-by: Thomas Rast <trast@student.ethz.ch>
* stash list: drop the default limit of 10 stashesThomas Rast2009-10-191-2/+1
| | | | | | | | | | | | | 'git stash list' had an undocumented limit of 10 stashes, unless other git-log arguments were specified. This surprised at least one user, but possibly served to cut the output below a screenful without using a pager. Since the last commit, 'git stash list' will fire up a pager according to the same rules as the 'git log' it calls, so we can drop the limit. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'maint-1.6.4' into maintJunio C Hamano2009-10-131-1/+2
|\ | | | | | | | | * maint-1.6.4: git-stash documentation: mention default options for 'list'
| * git-stash documentation: mention default options for 'list'Miklos Vajna2009-10-121-1/+2
| | | | | | | | | | Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'tr/reset-checkout-patch'Junio C Hamano2009-09-071-5/+17
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tr/reset-checkout-patch: stash: simplify defaulting to "save" and reject unknown options Make test case number unique tests: disable interactive hunk selection tests if perl is not available DWIM 'git stash save -p' for 'git stash -p' Implement 'git stash save --patch' Implement 'git checkout --patch' Implement 'git reset --patch' builtin-add: refactor the meat of interactive_add() Add a small patch-mode testing library git-apply--interactive: Refactor patch mode code Make 'git stash -k' a short form for 'git stash save --keep-index'