summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-07-12cat-file: add --batch-check=<format>Jeff King
The `cat-file --batch-check` command can be used to quickly get information about a large number of objects. However, it provides a fixed set of information. This patch adds an optional <format> option to --batch-check to allow a caller to specify which items they are interested in, and in which order to output them. This is not very exciting for now, since we provide the same limited set that you could already get. However, it opens the door to adding new format items in the future without breaking backwards compatibility (or forcing callers to pay the cost to calculate uninteresting items). Since the --batch option shares code with --batch-check, it receives the same feature, though it is less likely to be of interest there. The format atom names are chosen to match their counterparts in for-each-ref. Though we do not (yet) share any code with for-each-ref's formatter, this keeps the interface as consistent as possible, and may help later on if the implementations are unified. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-11cat-file: refactor --batch option parsingJeff King
We currently use an int to tell us whether --batch parsing is on, and if so, whether we should print the full object contents. Let's instead factor this into a struct, filled in by callback, which will make further batch-related options easy to add. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-11cat-file: teach --batch to stream blob objectsJeff King
The regular "git cat-file -p" and "git cat-file blob" code paths already learned to stream large blobs. Let's do the same here. Note that this means we look up the type and size before making a decision of whether to load the object into memory or stream (just like the "-p" code path does). That can lead to extra work, but it should be dwarfed by the cost of actually accessing the object itself. In my measurements, there was a 1-2% slowdown when using "--batch" on a large number of objects. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-11t1006: modernize output comparisonsJeff King
In modern tests, we typically put output into a file and compare it with test_cmp. This is nicer than just comparing via "test", and much shorter than comparing via "test" and printing a custom message. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-07teach sha1_object_info_extended a "disk_size" queryJeff King
Using sha1_object_info_extended, a caller can find out the type of an object, its size, and information about where it is stored. In addition to the object's "true" size, it can also be useful to know the size that the object takes on disk (e.g., to generate statistics about which refs consume space). This patch adds a "disk_sizep" field to "struct object_info", and fills it in during sha1_object_info_extended if it is non-NULL. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-07zero-initialize object_info structsJeff King
The sha1_object_info_extended function expects the caller to provide a "struct object_info" which contains pointers to "query" items that will be filled in. The purpose of providing pointers rather than storing the response directly in the struct is so that callers can choose not to incur the expense in finding particular fields that they do not care about. Right now the only query item is "sizep", and all callers set it explicitly to choose whether or not to query it; they can then leave the rest of the struct uninitialized. However, as we add new query items, each caller will have to be updated to explicitly turn off the new ones (by setting them to NULL). Instead, let's teach each caller to zero-initialize the struct, so that they do not have to learn about each new query item added. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-24Git 1.8.3v1.8.3Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-21remote-hg: fix order of configuration commentsFelipe Contreras
The other configurations were added in the wrong place. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-21remote-hg: trivial configuration note cleanupFelipe Contreras
Follow the style of the previous configurations. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-21completion: regression fix for zshFelipe Contreras
zsh completion wrapper doesn't reimplement __gitcompadd(). Although it should be trivial to do that, let's use __gitcomp_nl() which achieves exactly the same thing, specially since the suffix ($4) has to be empty. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-20Merge git://git.bogomips.org/git-svnJunio C Hamano
* git://git.bogomips.org/git-svn: git-svn: introduce --parents parameter for commands branch and tag git-svn: clarify explanation of --destination argument git-svn: multiple fetch/branches/tags keys are supported
2013-05-20git-svn: introduce --parents parameter for commands branch and tagTobias Schulte
This parameter is equivalent to the parameter --parents on svn cp commands and is useful for non-standard repository layouts. Signed-off-by: Tobias Schulte <tobias.schulte@gliderpilot.de> Signed-off-by: Eric Wong <normalperson@yhbt.net>
2013-05-20git-svn: clarify explanation of --destination argumentJonathan Nieder
The existing documentation for "-d" does not make it obvious whether its argument is supposed to be a full svn path, a partial svn path, the glob from the config file, or what. Clarify the text and add an example to get the reader started. Reported-by: Nathan Gray <n8gray@n8gray.org> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Eric Wong <normalperson@yhbt.net>
2013-05-20git-svn: multiple fetch/branches/tags keys are supportedNathan Gray
"git svn" can be configured to use multiple fetch, branches, and tags refspecs by passing multiple --branches or --tags options at init time or editing the configuration file later, which can be handy when working with messy Subversion repositories. Add a note to the configuration section documenting how this works. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Eric Wong <normalperson@yhbt.net>
2013-05-20remote-hg: set stdout to binary mode on win32Amit Bakshi
git clone hangs on windows, and file.write would return errno 22 inside of mercurial's windows.winstdout wrapper class. This patch sets stdout's mode to binary, fixing both issues. [fc: cleaned up] Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-17Git 1.8.3-rc3v1.8.3-rc3Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-17Merge branch 'fc/doc-style'Junio C Hamano
* fc/doc-style: documentation: trivial style cleanups
2013-05-17Merge branch 'dw/asciidoc-sources-are-dot-txt-files'Junio C Hamano
* dw/asciidoc-sources-are-dot-txt-files: CodingGuidelines: Documentation/*.txt are the sources
2013-05-17documentation: trivial style cleanupsFelipe Contreras
White-spaces, missing braces, standardize --[no-]foo. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-17Merge git://ozlabs.org/~paulus/gitkJunio C Hamano
* git://ozlabs.org/~paulus/gitk: gitk: Update Swedish translation (304t)
2013-05-17difftool: fix dir-diff when file does not exist in working treeJohn Keeping
Commit 02c5631 (difftool --dir-diff: symlink all files matching the working tree, 2013-03-14) does not handle the case where a file that is being compared does not exist in the working tree. Fix this by checking for existence explicitly before running git-hash-object. Reported-by: Kevin Bracey <kevin@bracey.fi> Signed-off-by: John Keeping <john@keeping.me.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-17remote-bzr: fixes for older versions of bzrFelipe Contreras
Down to v2.0, by using older but still valid interfaces. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-17remote-bzr: fix old organization destroySandor Bodo-Merle
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-16gitk: Update Swedish translation (304t)Peter Krefting
Signed-off-by: Peter Krefting <peter@softwolves.pp.se> Signed-off-by: Paul Mackerras <paulus@samba.org>
2013-05-16Revert "remote-hg: update bookmarks when pulling"Felipe Contreras
This reverts commit 24317ef32ac3111ed00792f9b2921dc19dd28fe2. Different versions of Mercurial have different arguments for bookmarks.updatefromremote(), while it should be possible to call the right function with the right arguments depending on the version, it's safer to restore the old behavior for now. Reported by Rodney Lorrimar. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-16git-submodule.txt: Clarify 'init' and 'add' subcommands.Dale R. Worley
Describe how 'add' sets the submodule's logical name, which is used in the configuration entry names. Clarify that 'init' only sets up the configuration entries for submodules that have already been added elsewhere. Describe that <path> arguments limit the submodules that are configured. Signed-off-by: Dale Worley <worley@ariadne.com> Acked-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-16remote-bzr: fix cloning of non-listable reposFelipe Contreras
Commit 95b0c60 (remote-bzr: add support for bzr repos) introduced a regression by assuming all bzr remote repos are listable, but they are not. If they are not listable they are basically useless, so let's assume there is no bzr repo. Reported-by: Thorsten Kranzkowski <dl8bcu@dl8bcu.de> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15Merge branch 'fc/remote-hg' (early part)Junio C Hamano
* 'fc/remote-hg' (early part): remote-hg: update bookmarks when pulling remote-hg: don't push fake 'master' bookmark remote-hg: disable forced push by default remote-hg: fix new branch creation remote-hg: add new get_config_bool() helper remote-hg: enable track-branches in hg-git mode remote-hg: get rid of unused exception checks remote-hg: trivial cleanups
2013-05-15remote-hg: update bookmarks when pullingFelipe Contreras
Otherwise, the user would never ever see new bookmarks, only the ones that (s)he initially cloned. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15remote-hg: don't push fake 'master' bookmarkFelipe Contreras
We skip it locally, but not for the remote, so let's do so. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15remote-hg: disable forced push by defaultFelipe Contreras
In certain situations we might end up pushing garbage revisions (e.g. in a rebase), and the patches to deal with that haven't been merged yet. So let's disable forced pushes by default. We are essentially reverting back to the old v1.8.2 behavior, to minimize the possibility of regressions, but in a way the user can configure. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15remote-hg: fix new branch creationFelipe Contreras
When a user creates a new branch with git: % git checkout -b branches/devel and then pushes this branch % git push origin branches/devel which is the way to push new mercurial branches, we do want to create a branch, but the command would fail without newbranch=True. This only matters when force_push=False, but setting newbranch=True unconditionally does not hurt. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15remote-hg: add new get_config_bool() helperFelipe Contreras
No functional changes. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15remote-hg: enable track-branches in hg-git modeFelipe Contreras
The user can turn this off. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15remote-hg: get rid of unused exception checksFelipe Contreras
Remove try/except check because we are no longer calling check_output(), which may throw an exception. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-15remote-hg: trivial cleanupsFelipe Contreras
Drop unused "global", and remove redundant comparison of two files. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-14remote-bzr: update old organizationFelipe Contreras
If a clone exists with the old organization (v1.8.2) it will prevent the new shared bzr repository organization from working, so let's remove this repository, which is not used any more. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-13Git 1.8.3-rc2v1.8.3-rc2Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-13Merge git://ozlabs.org/~paulus/gitkJunio C Hamano
* git://ozlabs.org/~paulus/gitk: gitk: On OSX, bring the gitk window to front gitk: Add support for -G'regex' pickaxe variant gitk: Add menu item for reverting commits gitk: Simplify file filtering gitk: Display the date of a tag in a human-friendly way gitk: Improve behaviour of drop-down lists gitk: Move hard-coded colors to .gitk
2013-05-13gitk: On OSX, bring the gitk window to frontTair Sabirgaliev
On OSX, Tcl/Tk application windows are created behind all the applications down the stack of windows. This is very annoying, because once a gitk window appears, it's the downmost window and switching to it is pain. The patch is: if we are on OSX, use osascript to bring the current Wish process window to front. Signed-off-by: Tair Sabirgaliev <tair.sabirgaliev@gmail.com> Thanks-to: Stefan Haller <lists@haller-berlin.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
2013-05-13gitk: Add support for -G'regex' pickaxe variantMartin Langhoff
git log -G'regex' is a very useful alternative to the classic pickaxe. Minimal patch to make it usable from gitk. [zj: reword message] [paulus@samba.org: reword droplist item] Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> Signed-off-by: Paul Mackerras <paulus@samba.org>
2013-05-11test-bzr: do not use unportable sed '\+'Torsten Bögershausen
Using sed -e '/[0-9]\+//' to find "one or more digits" is not portable. Use the Basic Regular Expression '/[0-9][0-9]*//' instead. Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-11Merge git://git.bogomips.org/git-svnJunio C Hamano
* git://git.bogomips.org/git-svn: git-svn: added an --include-path flag Git::SVN::*: add missing "NAME" section to perldoc git-svn: avoid self-referencing mergeinfo
2013-05-11gitk: Add menu item for reverting commitsKnut Franke
Sometimes it's helpful (at least psychologically) to have this feature easily accessible. Code borrows heavily from cherrypick. Signed-off-by: Knut Franke <Knut.Franke@gmx.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
2013-05-11gitk: Simplify file filteringFelipe Contreras
git diff is perfectly able to do this with '-- files', no need for manual filtering. This makes gettreediffs consistent with getblobdiffs. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
2013-05-11gitk: Display the date of a tag in a human-friendly wayAnand Kumria
By selecting a tag within gitk you can display information about it. This information is output by using the command 'git cat-file tag <tagid>' This outputs the *raw* information from the tag, amongst which is the time - in seconds since the epoch. As useful as that value is, I find it a lot easier to read and process time which it is something like: "Mon Dec 31 14:26:11 2012 -0800" This change will modify the display of tags in gitk like so: @@ -1,7 +1,7 @@ object 5d417842efeafb6e109db7574196901c4e95d273 type commit tag v1.8.1 -tagger Junio C Hamano <gitster@pobox.com> 1356992771 -0800 +tagger Junio C Hamano <gitster@pobox.com> Mon Dec 31 14:26:11 2012 -0800 Git 1.8.1 -----BEGIN PGP SIGNATURE----- Signed-off-by: Anand Kumria <wildfire@progsoc.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
2013-05-11gitk: Improve behaviour of drop-down listsPaul Mackerras
The drop-down lists used for things like the criteria for finding commits (containing/touching paths/etc.) use a combobox if we are using the ttk widgets. By default the combobox exports its value as the selection when it is changed, which is unnecessary, and sometimes the combobox wouldn't release the selection, which is annoying. To fix this, we make these comboboxes not export their selection, and also clear their selection whenever they are changed. This makes them more like a simple selection of alternatives, improving the look and feel of gitk. Signed-off-by: Paul Mackerras <paulus@samba.org>
2013-05-10CodingGuidelines: Documentation/*.txt are the sourcesDale Worley
People not familiar with AsciiDoc may not realize they are supposed to update *.txt files and not *.html/*.1 files when preparing patches to the project. Signed-off-by: Dale Worley <worley@ariadne.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-05-09Sync with v1.8.2.3Junio C Hamano
* maint: Git 1.8.2.3 t5004: avoid using tar for checking emptiness of archive t5004: ignore pax global header file mergetools/kdiff3: do not use --auto when diffing transport-helper: trivial style cleanup
2013-05-09Git 1.8.2.3v1.8.2.3Junio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>