summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-05-16sideband_demux(): fix decl-after-stmtLibravatar Junio C Hamano1-2/+2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-05-05send-pack: unbreak push over stateless rpcLibravatar Jeff King1-1/+2
Commit 09c9957 (send-pack: avoid deadlock when pack-object dies early, 2011-04-25) attempted to fix a hang in the stateless rpc case by closing a file descriptor early, but we still need that descriptor. Basically the deadlock can happen when pack-objects fails, and the descriptor to upstream is left open. We never send the pack, so the upstream is left waiting for us to say something, and we are left waiting for upstream to close the connection. In the non-rpc case, our descriptor points straight to the upstream. We hand it off to run-command, which takes ownership and closes the descriptor after pack-objects finishes (whether it succeeds or not). Commit 09c9957 tried to emulate that in the rpc case. That isn't right, though. We actually have a descriptor going back to the remote-helper, and we need to keep using it after pack-objects is finished. Closing it early completely breaks pushing via smart-http. We still need to do something on error to signal the remote-helper that we won't be sending any pack data (otherwise we get the deadlock). In an ideal world, we would send a special packet back that says "Sorry, there was an error". But the remote-helper doesn't understand any such packet, so the best we can do is close the descriptor and let it report that we hung up unexpectedly. Signed-off-by: Jeff King <peff@peff.net> Acked-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-25send-pack: avoid deadlock when pack-object dies earlyLibravatar Johannes Sixt1-0/+4
Send-pack deadlocks in two ways when pack-object dies early (for example, because there is some repo corruption). The first deadlock happens with the smart push protocol (--stateless-rpc). After the initial rev-exchange, the remote is waiting for the pack data to arrive, and the sideband demuxer at the local side continues trying to stream data from the remote repository until it gets EOF. Meanwhile, send-pack (in function pack_objects()) has noticed that pack-objects did not produce output and died. Back in send_pack(), it now tries to clean up the sideband demuxer using finish_async(). The demuxer, however, waits for the remote end to close down, the remote waits for pack data, and the reason that it still waits is that send-pack forgot to close the outgoing channel. Add the missing close() in pack_objects(). The second deadlock happens in a similar constellation when the sideband demuxer runs in a forked process (rather than in a thread). Again, the remote end waits for pack data to arrive, the sideband demuxer waits for the remote to shut down, and send-pack (in the regular clean-up) waits for the demuxer to terminate. This time, the send-pack parent process closes the writable end of the outgoing channel (in start_command() that spawned pack-objects) so that after the death of the pack-objects process all writable ends should have been closed and the remote repo should see EOF. This does not happen, however, because when the sideband demuxer was forked earlier, it also inherited a writable end; it remains open and keeps the remote repo from seeing EOF. To break this deadlock, close the writable end in the demuxer. Analyzed-by: Jeff King <peff@peff.net> Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-05receive-pack: Wrap status reports inside side-band-64kLibravatar Shawn O. Pearce1-8/+22
If the client requests the side-band-64k protocol capability we now wrap the status report data inside of packets sent to band #1. This permits us to later send additional progress or informational messages down band #2. If side-band-64k was enabled, we always send a final flush packet to let the client know we are done transmitting. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-05receive-pack: Refactor how capabilities are shown to the clientLibravatar Shawn O. Pearce1-10/+8
Moving capability advertisement into the packet_write call itself makes it easier to add additional capabilities to the list, be it optional by configuration, or always present in the protocol. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-05send-pack: demultiplex a sideband stream with status dataLibravatar Shawn O. Pearce1-16/+50
If the server advertises side-band-64k capability, we request it and pull the status report data out of side band #1, and let side band #2 go to our stderr. The latter channel be used by the remote side to send our user messages. This basically mirrors the side-band-64k capability in upload-pack. Servers may choose to use side band #2 to send error messages from hook scripts that are meant for the push end user. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-05run-command: support custom fd-set in asyncLibravatar Erik Faye-Lund7-37/+131
This patch adds the possibility to supply a set of non-0 file descriptors for async process communication instead of the default-created pipe. Additionally, we now support bi-directional communiction with the async procedure, by giving the async function both read and write file descriptors. To retain compatiblity and similar "API feel" with start_command, we require start_async callers to set .out = -1 to get a readable file descriptor. If either of .in or .out is 0, we supply no file descriptor to the async process. [sp: Note: Erik started this patch, and a huge bulk of it is his work. All bugs were introduced later by Shawn.] Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-05run-command: Allow stderr to be a caller supplied pipeLibravatar Shawn O. Pearce3-2/+10
Like .out, .err may now be set to a file descriptor > 0, which is a writable pipe/socket/file that the child's stderr will be redirected into. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-05Update git fsck --full short description to mention packsLibravatar Wesley J. Landaker1-1/+1
The '--full' option to git fsck does two things: 1) Check objects in packs 2) Check alternate objects This is documented in the git fsck manual; this patch reflects that in the short git fsck option help message as well. Signed-off-by: Wesley J. Landaker <wjl@icecavern.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-05Merge branch 'jc/maint-limit-note-output' into maintLibravatar Junio C Hamano8-1/+85
* jc/maint-limit-note-output: Fix "log --oneline" not to show notes Fix "log" family not to be too agressive about showing notes
2010-01-29Merge branch 'maint-1.6.5' into maintLibravatar Junio C Hamano1-1/+1
* maint-1.6.5: fix memcpy of overlapping area
2010-01-29fix memcpy of overlapping areaLibravatar Jeff King1-1/+1
Caught by valgrind in t5500, but it is pretty obvious from reading the code that this is shifting elements of an array to the left, which needs memmove. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-28bash: don't offer remote transport helpers as subcommandsLibravatar SZEDER Gábor1-0/+1
Since commits a2d725b7 (Use an external program to implement fetching with curl, 2009-08-05) and c9e388bb (Make the "traditionally-supported" URLs a special case, 2009-09-03) remote transport helpers like 'remote-ftp' and 'remote-curl' are offered by the completion script as available subcommands. Not good, since they are helpers, therefore should not be offered, so filter them out. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-24Merge branch 'maint' of git://git.spearce.org/git-gui into maintLibravatar Junio C Hamano5-23/+48
* 'maint' of git://git.spearce.org/git-gui: git-gui: work from the .git dir git-gui: Fix applying a line when all following lines are deletions git-gui: Correct file_states when unstaging partly staged entry git-gui: Fix gitk for branch whose name matches local file git-gui: Keep repo_config(gui.recentrepos) and .gitconfig in sync git-gui: handle really long error messages in updateindex. git-gui: Add hotkeys for "Unstage from commit" and "Revert changes" git-gui: Makefile: consolidate .FORCE-* targets
2010-01-23git-gui: work from the .git dirLibravatar Giuseppe Bilotta1-0/+10
When git-gui is run from a .git dir, _gitdir would be set to "." by rev-parse, something that confuses the worktree detection. Fix by expanding the value of _gitdir to pwd in this special case. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23git-gui: Fix applying a line when all following lines are deletionsLibravatar Jeff Epler1-0/+1
If a diff looked like: @@ context -del1 -del2 and you wanted to stage the deletion 'del1', the generated patch wouldn't apply because it was missing the line 'del2' converted to context, but this line was counted in the @@-line Signed-off-by: Jeff Epler <jepler@unpythonic.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23git-gui: Correct file_states when unstaging partly staged entryLibravatar Jens Lehmann1-0/+3
When unstaging a partly staged file or submodule, the file_states list was not updated properly (unless unstaged linewise). Its index_info part did not contain the former head_info as it should have but kept its old value. This seems not to have had any bad effects but diminishes the value of the file_states list for future enhancements. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23git-gui: Fix gitk for branch whose name matches local fileLibravatar Peter Krefting1-1/+1
When trying to run gitk on a branch name whose name matches a local file, it will toss an error saying that the name is ambiguous. Adding a pair of dashes will make gitk parse the options to the left of it as branch names. Since wish eats the first pair of dashes we throw at it, we need to add a second one to ensure they get through. Signed-off-by: Peter Krefting <peter@softwolves.pp.se> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23git-gui: Keep repo_config(gui.recentrepos) and .gitconfig in syncLibravatar Christopher Beelby1-0/+4
When the number of recent repo's gets to ten there can be a situation where an item is removed from the .gitconfig file via a call to git config --unset, but the internal representation of that file (repo_config(gui.recentrepo)) is not updated. Then a subsequent attempt to remove an item from the list fails because git-gui attempts to call --unset on a value that has already been removed. This leads to duplicates in the .gitconfig file, which then also cause errors if the git-gui tries to --unset them (rather than using --unset-all. --unset-all is not used because it is not expected that duplicates should ever be allowed to exist.) When loading the list of recent repositories (proc _get_recentrepos) if a repo in the list is not considered a valid git reposoitory then we should go ahead and remove it so it doesn't take up a slot in the list (since we limit to 10 items). This will prevent a bunch of invalid entries in the list (which are not shown) from making valid entries dissapear off the list even when there are less than ten valid entries. See: http://code.google.com/p/msysgit/issues/detail?id=362 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-23git-gui: handle really long error messages in updateindex.Libravatar Pat Thoyts1-16/+18
As reported to msysGit (bug #340) it is possible to get some very long error messages when updating the index. The use of a label to display this prevents scrolling the output. This patch replaces the label with a scrollable text widget configured to look like a label. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-01-22ignore duplicated slashes in make_relative_path()Libravatar Junio C Hamano2-9/+36
The function takes two paths, an early part of abs is supposed to match base; otherwise abs is not a path under base and the function returns the full path of abs. The caller can easily confuse the implementation by giving duplicated and needless slashes in these path arguments. Credit for test script, motivation and initial patch goes to Thomas Rast. A follow-up fix (squashed) is by Hannes. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-21merge-recursive: do not return NULL only to cause segfaultLibravatar Junio C Hamano1-4/+4
merge-recursive calls write_tree_from_memory() to come up with a virtual tree, with possible conflict markers inside the blob contents, while merging multiple common ancestors down. It is a bug to call the function with unmerged entries in the index, even if the merge to come up with the common ancestor resulted in conflicts. Otherwise the result won't be expressible as a tree object. We _might_ want to suggest the user to set GIT_MERGE_VERBOSITY to 5 and re-run the merge in the message. At least we will know which part of process_renames() or process_entry() functions is not correctly handling the unmerged paths, and it might help us diagnosing the issue. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-21retry request without query when info/refs?query failsLibravatar Tay Ray Chuan1-2/+16
When "info/refs" is a static file and not behind a CGI handler, some servers may not handle a GET request for it with a query string appended (eg. "?foo=bar") properly. If such a request fails, retry it sans the query string. In addition, ensure that the "smart" http protocol is not used (a service has to be specified with "?service=<service name>" to be conformant). Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Reported-and-tested-by: Yaroslav Halchenko <debian@onerussian.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-21Fix "log --oneline" not to show notesLibravatar Junio C Hamano3-4/+7
This option should be treated pretty much the same as --format="%h %s". Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-20Merge branch 'jc/maint-refresh-index-is-optional-for-status' into maintLibravatar Junio C Hamano1-4/+6
* jc/maint-refresh-index-is-optional-for-status: status: don't require the repository to be writable
2010-01-20Fix "log" family not to be too agressive about showing notesLibravatar Junio C Hamano8-1/+82
Giving "Notes" information in the default output format of "log" and "show" is a sensible progress (the user has asked for it by having the notes), but for some commands (e.g. "format-patch") spewing notes into the formatted commit log message without being asked is too aggressive. Enable notes output only for "log", "show", "whatchanged" by default and only when the user didn't ask any specific --pretty/--format from the command line; users can explicitly override this default with --show-notes and --no-notes option. Parts of tests are taken from Jeff King's fix. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-20Git 1.6.6.1Libravatar Junio C Hamano3-8/+16
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-20Merge branch 'bg/maint-remote-update-default' into maintLibravatar Junio C Hamano2-6/+18
* bg/maint-remote-update-default: Fix "git remote update" with remotes.defalt set
2010-01-20Merge branch 'sb/maint-octopus' into maintLibravatar Junio C Hamano2-9/+57
* sb/maint-octopus: octopus: remove dead code octopus: reenable fast-forward merges octopus: make merge process simpler to follow Conflicts: git-merge-octopus.sh
2010-01-20Merge branch 'bg/maint-add-all-doc' into maintLibravatar Junio C Hamano2-29/+88
* bg/maint-add-all-doc: git-rm doc: Describe how to sync index & work tree git-add/rm doc: Consistently back-quote Documentation: 'git add -A' can remove files
2010-01-20Merge branch 'maint-1.6.5' into maintLibravatar Junio C Hamano5-9/+40
* maint-1.6.5: Git 1.6.5.8 Fix mis-backport of t7002 bash completion: factor submodules into dirty state reset: unbreak hard resets with GIT_WORK_TREE Conflicts: Documentation/git.txt GIT-VERSION-GEN RelNotes
2010-01-20Git 1.6.5.8Libravatar Junio C Hamano4-3/+32
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-20Merge branch 'jk/maint-1.6.5-reset-hard' into maint-1.6.5Libravatar Junio C Hamano2-4/+8
* jk/maint-1.6.5-reset-hard: reset: unbreak hard resets with GIT_WORK_TREE
2010-01-20Merge branch 'tr/maint-1.6.5-bash-prompt-show-submodule-changes' into ↵Libravatar Junio C Hamano1-4/+2
maint-1.6.5 * tr/maint-1.6.5-bash-prompt-show-submodule-changes: bash completion: factor submodules into dirty state
2010-01-20Merge branch 'dp/maint-1.6.5-fast-import-non-commit-tag' into maint-1.6.5Libravatar Junio C Hamano1-5/+5
* dp/maint-1.6.5-fast-import-non-commit-tag: fast-import: tag may point to any object type
2010-01-20Merge branch 'jm/maint-1.6.5-grep-NUL-terminate' into maint-1.6.5Libravatar Junio C Hamano1-0/+1
* jm/maint-1.6.5-grep-NUL-terminate: grep: NUL terminate input from a file
2010-01-19status: don't require the repository to be writableLibravatar Junio C Hamano1-4/+6
We need to update the index before hooks run when actually making a commit, but we shouldn't have to write the index when running "status". If we can, then we have already spent cycles to refresh the index and it is a waste not to write it out, but it is not a disaster if we cannot write it out. The main reason the user is running "git status" is to get the "status", and refreshing the index is a mere side effect that we can do without. Discovery and initial attempted fix by Dscho. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-19bisect: fix singular/plural grammar nitLibravatar David Ripton1-3/+5
Remove the trailing 's' from "revisions" and "steps" when there is only one. Signed-off-by: David Ripton <dripton@ripton.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-18Merge branch 'maint-1.6.4' into maint-1.6.5Libravatar Junio C Hamano8-43/+47
* maint-1.6.4: Fix mis-backport of t7002 base85: Make the code more obvious instead of explaining the non-obvious base85: encode_85() does not use the decode table base85 debug code: Fix length byte calculation checkout -m: do not try to fall back to --merge from an unborn branch branch: die explicitly why when calling "git branch [-a|-r] branchname". textconv: stop leaking file descriptors commit: --cleanup is a message option git count-objects: handle packs bigger than 4G t7102: make the test fail if one of its check fails
2010-01-18Merge branch 'maint-1.6.3' into maint-1.6.4Libravatar Junio C Hamano8-43/+47
* maint-1.6.3: base85: Make the code more obvious instead of explaining the non-obvious base85: encode_85() does not use the decode table base85 debug code: Fix length byte calculation checkout -m: do not try to fall back to --merge from an unborn branch branch: die explicitly why when calling "git branch [-a|-r] branchname". textconv: stop leaking file descriptors commit: --cleanup is a message option git count-objects: handle packs bigger than 4G t7102: make the test fail if one of its check fails Conflicts: builtin-commit.c
2010-01-18Merge branch 'maint-1.6.2' into maint-1.6.3Libravatar Junio C Hamano8-43/+47
* maint-1.6.2: base85: Make the code more obvious instead of explaining the non-obvious base85: encode_85() does not use the decode table base85 debug code: Fix length byte calculation checkout -m: do not try to fall back to --merge from an unborn branch branch: die explicitly why when calling "git branch [-a|-r] branchname". textconv: stop leaking file descriptors commit: --cleanup is a message option git count-objects: handle packs bigger than 4G t7102: make the test fail if one of its check fails Conflicts: diff.c
2010-01-18Merge commit 'v1.6.4.4-8-g8de6518' into maint-1.6.4Libravatar Junio C Hamano1-1/+5
* commit 'v1.6.4.4-8-g8de6518': Fix mis-backport of t7002
2010-01-18Fix mis-backport of t7002Libravatar Junio C Hamano1-1/+5
The original patch that became cfe370c (grep: do not segfault when -f is used, 2009-10-16), was made against "maint" or newer branch back then, but the fix addressed the issue that was present as far as in 1.6.4 series. The maintainer backported the patch to the 1.6.4 maintenance branch, but failed to notice that the new tests assumed the setup done by the script in "maint", which did quite a lot more than the same test script in 1.6.4 series, and the output didn't match the expected result. This should fix it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-18Update draft release notes to 1.6.6.1Libravatar Junio C Hamano1-1/+16
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-18Merge branch 'dp/maint-1.6.5-fast-import-non-commit-tag' into maintLibravatar Junio C Hamano1-5/+5
* dp/maint-1.6.5-fast-import-non-commit-tag: fast-import: tag may point to any object type
2010-01-18Merge branch 'jm/maint-1.6.5-grep-NUL-terminate' into maintLibravatar Junio C Hamano1-0/+1
* jm/maint-1.6.5-grep-NUL-terminate: grep: NUL terminate input from a file
2010-01-18grep: NUL terminate input from a fileLibravatar Jim Meyering1-0/+1
Internally "git grep" runs regexec(3) that expects its input string to be NUL terminated. When searching inside blob data, read_sha1_file() automatically gives such a buffer, but builtin-grep.c forgot to put the NUL at the end, even though it allocated enough space for it. Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-15Fix uninitialized variable in get_refs_via_rsync().Libravatar Richard Weinberger1-1/+1
This fixes a crash when cloning via rsync://. Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-14Document git-blame triple -C optionLibravatar Ramkumar Ramachandra2-3/+5
Lift the explanation of -CCC option in the source to the documentation. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-14fast-import: tag may point to any object typeLibravatar Dmitry Potapov1-5/+5
If you tried to export the official git repository, and then to import it back then git-fast-import would die complaining that "Mark :1 not a commit". Accordingly to a generated crash file, Mark 1 is not a commit but a blob, which is pointed by junio-gpg-pub tag. Because git-tag allows to create such tags, git-fast-import should import them. Signed-off-by: Dmitry Potapov <dpotapov@gmail.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>