Currently, trying to use git-commit with unmerged files in the index
will show the message "Error building trees", which can be a bit
obscure to the end user. This patch makes the error message clearer, and
consistent with what git-write-tree reports in a similar situation.
Signed-off-by: Rafael Garcia-Suarez <rgarciasuarez@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
The field device is not used by Git, and putting the number of the
current device is meaningless anyway.
Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Acked-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Besides, it fixes a memleak (builtin-rm.c) and accidental change of
the input const argument (builtin-merge-recursive.c).
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
The function has two potential users which both managed to get wrong
their implementations (the one in builtin-rm.c one has a memleak, and
builtin-merge-recursive.c scribles over its const argument).
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Since commit 55218("checkout: do not lose staged removal"), in
cmd_add/cmd_update, "git checkout <commit>" following
"git clone -n" may fail if <commit> is different from HEAD.
So Use "git checkout -f <commit>" to fix this.
Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Our poll() emulation did not support the timeout argument. With this patch
we support it for the simple case where poll() does not need to wait on
file descriptors as well because this case amounts to a mere Sleep().
This is needed if the user sets help.autocorrect is set to a positive
value.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This removes three functions that are not used anywhere.
Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Acked-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* maint:
Remove empty directories in recursive merge
Documentation: clarify the details of overriding LESS via core.pager
Conflicts:
builtin-merge-recursive.c
The code was actually supposed to do that, but was accidentally broken.
Noticed by Anders Melchiorsen.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
The process of overriding the default LESS options using only
git-specific methods is rather obscure. Show the end user how
to do it in a step-by-step manner.
Signed-off-by: Chris Frey <cdfrey@foursquare.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* mv/merge-recursive:
builtin-merge: release the lockfile in try_merge_strategy()
merge-recursive: get rid of virtual_id
merge-recursive: move current_{file,directory}_set to struct merge_options
merge-recursive: move the global obuf to struct merge_options
merge-recursive: get rid of the index_only global variable
merge-recursive: move call_depth to struct merge_options
cherry-pick/revert: make direct internal call to merge_tree()
builtin-merge: avoid run_command_v_opt() for recursive and subtree
merge-recursive: introduce merge_options
merge-recursive.c: Add more generic merge_recursive_generic()
Split out merge_recursive() to merge-recursive.c
* jc/alternate-push:
push: receiver end advertises refs from alternate repositories
push: prepare sender to receive extended ref information from the receiver
receive-pack: make it a builtin
is_directory(): a generic helper function
* mv/commit-tree:
t7603: add new testcases to ensure builtin-commit uses reduce_heads()
builtin-commit: use commit_tree()
commit_tree(): add a new author parameter
If $hash_parent is defined, shortlog now limits the list of commits at
those between $hash_parent (exclusive) and $hash (inclusive).
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* git://repo.or.cz/git-gui:
git-gui: Reenable staging unmerged files by clicking the icon.
git-gui: Support the encoding menu in gui blame.
git-gui: Optimize encoding name resolution using a lookup table.
git-gui: Allow forcing display encoding for diffs using a submenu.
git-gui: Add a menu of available encodings.
git-gui: Cleanup handling of the default encoding.
git-gui: Assume `blame --incremental` output is in UTF-8
git-gui: Use gitattribute "encoding" for file content display
git-gui: Add support for calling out to the prepare-commit-msg hook
git-gui: Hide commit related UI during citool --nocommit
git-gui: Add more integration options to citool.
git-gui: Updated German translation.
git-gui: I18n fix sentence parts into full sentences for translation again.
git-gui: Restore ability to Stage Working Copy for conflicts.
git-gui: Fix Blame Parent & Context for working copy lines.
* maint:
Update release notes for 1.6.0.3
checkout: Do not show local changes when in quiet mode
for-each-ref: Fix --format=%(subject) for log message without newlines
git-stash.sh: don't default to refs/stash if invalid ref supplied
maint: check return of split_cmdline to avoid bad config strings
These function are not used anywhere. Also removes graph_release()
that is never called.
Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
These functions are not used by any other file.
Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
'git for-each-ref --format=%(subject)' currently returns an empty string
if the log message does not contain a newline.
This patch teaches 'git for-each-ref' to return the entire log message
(instead of an empty string) if there is no newline in the log message.
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
In the future, I think we should also default to xdg-open on Linux instead
of having a KDE-specific hack.
This patch has been sponsored by Novartis.
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This restores functionality of the file icon for unmerged files.
Safety is enforced by loading the diff and checking for lines
that look like conflict markers. If such lines are found, or
the conflict involves deletion and/or symlinks, a confirmation
dialog is presented. Otherwise, the icon immediately stages the
working copy version of the file.
Includes a revert of 2fe5b2ee42
(Restore ability to Stage Working Copy for conflicts)
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Tested-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Allow dynamically changing the encoding from the blame
viewer as well.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Tested-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Encoding menu construction does almost a hundred of encoding
resolutions, which with the old implementation led to a
small but noticeable delay.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Tested-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Add a submenu to allow dynamically changing the encoding to use
for diffs. Encoding settings are remembered while git-gui runs.
The rules are:
1) Encoding set for a specific file overrides gitattributes.
2) Last explicitly set value of the encoding overrides gui.encoding
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Tested-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
To make encoding selection easier, add a menu that
lists available encodings to the Options window.
Menu structure is borrowed from Firefox.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Tested-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
- Make diffs and blame default to the system (locale)
encoding instead of hard-coding UTF-8.
- Add a gui.encoding option to allow overriding it.
- gitattributes still have the final word.
The rationale for this is Windows support:
1) Windows people are accustomed to using legacy encodings
for text files. For many of them defaulting to utf-8
will be counter-intuitive.
2) Windows doesn't support utf-8 locales, and switching
the system encoding is a real pain. Thus the option.
This patch also adds proper encoding conversion to Apply Hunk/Line.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Tested-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Most commits have author name encoded in UTF-8, but the incremental
blame output dumps raw bytes and doesn't give us the encoding header
from the commit. Rather than fixing up tooltip data after we have
viewed that particular commit in the blame viewer we can assume all
names are in UTF-8.
This is still going to cause problems when the author name is not
encoded in UTF-8, but the only (efficient) way to solve that is to
add an "encoding" header to the blame --incremental mode output,
as otherwise we need to run `git cat-file commit $sha1` for each
and every commit identified and that would be horribly expensive
on any platform.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Most folks using git-gui on internationalized files have complained
that it doesn't recognize UTF-8 correctly. In the past we have just
ignored the problem and showed the file contents as binary/US-ASCII,
which is wrong no matter how you look at it.
This really should be a per-file attribute, managed by .gitattributes,
so we now pull the "encoding" attribute data for the given path from
the .gitattributes (if available) and use that, falling back to UTF-8
if the attributes are unavailable, git-check-attr is broken, or an
encoding for this path not specified.
We apply the encoding anytime we show file content, which currently
is limited to only the diff viewer and the blame viewer.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
If the user started git-gui as "git citool --nocommit" then they
don't need the new commit / amend commit radio buttons, or the sign
off button in the UI. Rather than use up space with options the
user cannot activate they are simply not installed into the UI.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
- Make citool return nonzero exit code if it did not commit.
- Add a mode where it does not actually commit and simply
exits with zero code. Commit message is either disabled,
or simply dumped to GITGUI_EDITMSG before exiting.
- Add an option to immediately start it in amend mode.
Rationale:
1) Use 'git citool --nocommit' instead of mergetool in scripts.
2) Use 'git citool --amend' to edit commits while rebasing.
Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
apply_stash() and show_stash() each call rev-parse with
'--default refs/stash' as an argument. This option causes rev-parse to
operate on refs/stash if it is not able to successfully operate on any
element of the command line. This includes failure to supply a "valid"
revision. This has the effect of causing 'stash apply' and 'stash show'
to operate as if stash@{0} had been supplied when an invalid revision is
supplied.
e.g. 'git stash apply stash@{1}' would fall back to
'git stash apply stash@{0}'
This patch modifies these two functions so that they avoid using the
--default option of rev-parse.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Generally, the dependent clause "for example" is suffixed with a comma.
Used present tense where appropriate to be consistent with the other
paragraphs.
Rewrote the paragraph in the second hunk to be more clear.
Signed-off-by: Garry Dolley <gdolley@ucla.edu>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
As the testcase demonstrates, it's possible for split_cmdline to return -1 and
deallocate any memory it's allocated, if the config string is missing an end
quote. In both the cases below, which are the only calling sites, the return
isn't checked, and using the pointer causes a pretty immediate segfault.
Signed-off-by: Deskin Miller <deskinm@umich.edu>
Acked-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
[jc: fixes bibtex pattern breakage exposed by this test]
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>