summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2007-01-21git-gui: Bind M1-N to create branch.Libravatar Shawn O. Pearce1-0/+6
Creating branches is a common enough activity within a Git project that we probably should give it a keyboard accelerator. N is not currently used and seems reasonable to stand for "New Branch". To bad our menu calls it create. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Implemented create branch GUI.Libravatar Shawn O. Pearce1-3/+180
Users may now create new branches by activating the Branch->Create menu item. This opens a dialog which lets the user enter the new branch name and select the starting revision for the new branch. For the starting revision we allow the user to either select from a list of known heads (aka local branches) or to enter an arbitrary SHA1 expression. For either creation technique we run the starting revision through rev-parse to verify it is valid before trying to create the ref with update-ref. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Pad the cancel/save buttons in the options window.Libravatar Shawn O. Pearce1-1/+1
It looks horrible to have the cancel and save buttons wedged up against each other in our options dialog. Therefore toss a 5 pixel pad between them. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Only permit selection in one list at a time.Libravatar Shawn O. Pearce1-10/+11
Now that our lists represent more defined states it no longer makes any sense to permit a user to make selections from both lists at once, as the each available operation acts only on files whose status corresponds to only one of the lists. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Simplify printing of index info to update-index.Libravatar Shawn O. Pearce1-4/+1
During unstaging we can simplify the way we perform the output by combining our four puts into a single call. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Refactor the add to commit state filters.Libravatar Shawn O. Pearce1-35/+15
The list of states which are valid for update-index were a little too verbose and fed a few too many cases to the program. We can do better with less lines of code by using more pattern matching, and since we already were globbing here there's little change in runtime cost. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Refactor the revert (aka checkout-index) implementation.Libravatar Shawn O. Pearce1-18/+9
We can revert any file which has a valid stage 0 (is not unmerged) and which is has a working directory status of M or D. This vastly simplifies our pattern matching on file status when building up the list of files to perform a checkout-index against. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Add or unstage based on the specific icon used.Libravatar Shawn O. Pearce1-8/+2
Rather than relying on the file state and just inverting it, we should look at which file icon the user clicked on. If they clicked on the one in the "Changes To Be Committed" list then they want to unstage the file. If they clicked on the icon in the "Changed But Not Updated" list then they want to add the file to the commit. This should be much more reliable about capturing the user's intent then looking at the file state. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Refactor add/remove proc names to align with reality.Libravatar Shawn O. Pearce1-22/+22
Now that core Git refers to resetting paths in the index as "unstaging" the paths we should do the same in git-gui, both internally in our code and also within the menu action name. The same follows for our staging logic, as core Git refers to this as 'add'. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Cleanup state descriptions.Libravatar Shawn O. Pearce1-14/+14
Updated the state descriptions for individual file states to try and make them more closely align with what git-runstatus might display. This way a user who is reading Git documentation will be less confused by our descriptions. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Remove invalid DM state.Libravatar Shawn O. Pearce1-4/+2
The DM state cannot really happen. Its implying that the file has been deleted in the index, but the file in the working directory has been modified relative to the file in the index. This is complete nonsense, the file doesn't exist in the index for it to be different against! Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Correct DD file state to be only D_.Libravatar Shawn O. Pearce1-4/+3
Apparently my earlier suspicion that the file state DD was a bug was correct. A file which has been deleted from the working directory and from the index will always get the state of D_ during a rescan. Thus the only valid state for this to have is D_. We should always use only D_ internally during our state changes. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Convert UI to use 'staged for commit' interface.Libravatar Shawn O. Pearce1-113/+101
This is a rather drastic change to the git-gui user interface, but it doesn't really look any different yet. I've taken the two lists and converted them to being "changes to be committed" and "changed but not updated". These lists correspond to the same lists output by git-runstatus based on how files differ in the HEAD<->index and the index<->working directory comparsions it performs. This change is meant to correlate with the change in Git 1.5.0 where we have brought the index more into the foreground and are trying to teach users to make use of it as part of their daily operations. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Start file status display refactoring.Libravatar Shawn O. Pearce1-27/+27
I'm going to refactor the way file status information gets displayed so it more closely aligns with the way 'git-runstatus' displays the differences between HEAD<->index and index<->working directory. To that end the other file list is going to be changed to be the working directory difference. So this change renames it. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Display the directory we are entering during startup.Libravatar Shawn O. Pearce1-1/+6
If the user has many git-gui icons it may be confusing when they start one which git-gui is still coming up. So on the windows systems we now include an echo statement which displays the full pathname of the working directory we are trying to enter into. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Make the gitk starting message match our usual format.Libravatar Shawn O. Pearce1-1/+1
Because we usually say "Operation... please wait..." we should do the same thing when starting gitk. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Allow [gitdir ...] to act as [file join [gitdir] ...].Libravatar Shawn O. Pearce1-17/+20
Because it is such a common idiom to use [gitdir] along with [file join] to locate the path of an item within the .git directory of the current repository we might as well allow gitdir to act as a wrapper for the file join operation. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Cleanup usage of gitdir global variable.Libravatar Shawn O. Pearce1-110/+97
The gitdir global variable is essentially read-only, and is used rather frequently. So are appname and reponame. Needing to constantly declare 'global appname' just so we can access the value as $appname is downright annoying and redundant. So instead I'm declaring these as procedures and changing all uses to invoke the procedure rather than access the global directly. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Refactor reponame computation.Libravatar Shawn O. Pearce1-19/+7
We use reponame in a number of locations, and every time its always the same value. Instead of computing this multiple times with code that was copied and pasted around we can compute it once immediately after the global gitdir has been computed and set. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Suggest when running 'git gc' may be worthwhile.Libravatar Shawn O. Pearce1-0/+40
Users often forget to repack their object database, then start to complain about how slow it is to perform common operations after they have collected thousands of loose objects in their objects directory. A simple repack usually restores performance. During startup git-gui now asks git-count-objects how many loose objects exist, and if this number exceeds a hardcoded threshold we suggest that the user compress the database (aka run 'git gc') at this time. I've hardcoded this to 2000 objects on non-Windows systems as there the filesystems tend to handle the ~8 objects per directory just fine. On Windows NTFS and FAT are just so slow that we really start to lag when more than 200 loose objects exist, so the hardcoded threshold is much lower there. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Don't offer my miga hack if its configuration file isn't present.Libravatar Shawn O. Pearce1-1/+2
I really hate that I have this specialized hack within git-gui, but its here. The hack shouldn't be offered unless miga's required .pvcsrc file is in the top level of the repository's working directory. If this file is missing miga will fail to startup properly, and the user cannot wouldn't be able to use it within this directory. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Allow the user to copy the version data to the clipboard.Libravatar Shawn O. Pearce1-0/+10
If a user wants to report an issue they will likely want to include the version number with their issue report. This may be difficult to enter if the version number includes an abbreviated commit SHA1 on the end of it. So we now give the user a context menu option on the version box which allows them to copy all of the relevant version data to the clipboard, ready for pasting into a report. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Ensure version number is always current.Libravatar Shawn O. Pearce4-6/+63
I'm stealing the exact logic used by core Git within its own Makefile to setup the version number within scripts and executables. This way we can be sure that the version number is always updated after a commit, and that the version number also reflects when it is coming from a dirty working directory (and is thus pretty worthless). I've cleaned up some of the version display code in the about dialog too. There were simply too many blank lines in the bottom section where we showed the version data. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Display the full GPL copyright notice in about dialog.Libravatar Shawn O. Pearce1-5/+13
We're a true GPL program, and we're interactive. We should show the entire GPL notice and disclaimer of warranty in our about dialog upon request by the user, as well as include it in the header of our source. Perhaps overkill, but is recommended by our license. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Display the git-gui version in the Help->About dialog.Libravatar Shawn O. Pearce1-3/+4
Now that we know what version git-gui is, the about dialog should display it to the end-user. This way users can find out what version they have before they report a problem or request a feature. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Modified makefile to embed version into git-gui script.Libravatar Shawn O. Pearce4-5/+32
We want to embed the version of git-gui directly into the script file, so that we can display it properly in the about dialog. Consequently I've refactored the Makefile process to act like the one in core git.git with regards to shell scripts, allowing git-gui to be constructed by a sed replacement performed on git-gui.sh. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Hide the ugly bash command line from the windows desktop icon.Libravatar Shawn O. Pearce1-1/+1
The user really doesn't need to see the technical details of how we launch git-gui from within their "desktop icon". Instead we should hide the command line from being displayed when the icon launches by putting @ at the start of the line. If they really need to see the command we are running they can edit the batch file. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Change more 'include' language to 'add'.Libravatar Shawn O. Pearce1-7/+7
I just found a whole slew of places where we still were using the term 'include' rather than 'add' to refer to the act of updating the index with modifications from the working directory. To be consistent with all Git documentation and command line tools, these should be 'add'. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Work around odd cygpath bug on Windows.Libravatar Shawn O. Pearce1-1/+1
There appears to be a bug on one of my test systems where cygpath with the --long-name option is generating a corrupt string that does not actually refer to sh.exe. This breaks any desktop icon created by git-gui as the executable we are trying to invoke does not exist. Since Cygwin is typically installed as C:\cygwin long path names is probably not actually necessary to link to the shell. I also added a small echo to the start of the icon script, as it can take one of my test systems several seconds to startup git-gui. This way the user knows we're starting git-gui, and was politely asked to wait for the action to complete. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Correct wording of the revert confirmation dialog.Libravatar Shawn O. Pearce1-2/+2
We no longer describe updating the index as including changes, as we now use the add notation used by core Git's command line tools. So its confusing to be talking about unincluded changes within the revert dialog. Instead we should used language like 'unadded changes'. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Corrected behavior of deleted (but existing in HEAD) files.Libravatar Shawn O. Pearce1-0/+2
Apparently I did not account for the D_ file state. This can occur when a file has been marked for deletion by deleting it from the index, and the file also does not exist in the working directory. Typically this happens when the user deletes the file, hits Rescan, then includes the missing file in the commit, then hits Rescan again. We don't find the file in the working directory but its been removed in the index, so the state becomes D_. This state should be identical with DD. I'm not entirely sure why DD occurs sometimes and D_ others, it would seem like D_ is the state that should be happening instead of DD, leading me to believe there is a quirk in git-gui's state manipulation code. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Run git-gc rather than git-repack.Libravatar Shawn O. Pearce1-9/+5
Now that git 1.5.0-rc1 and later has a 'git gc' command which performs all important repository management activites (including reflog pruning, repacking local objects, unnecessary loose object pruning and rerere cache expiration) we should run 'gc' when the user wants us to cleanup their object database for them. I think the name 'gc' is horrible for a GUI application like git-gui, so I'm labeling the menu action 'Compress Database' instead. Hopefully this will provide some clue to the user about what the action does. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Show all fetched branches for remote pulls.Libravatar Shawn O. Pearce1-8/+9
Loop through every remote.<name>.fetch entry and add it as a valid option in the Pull menu. This way users can pull any remote branch that they track, without needing to leave the gui. Its a rather crude work around for not having a full merge interface. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Created very crude Tools menu, to support miga.Libravatar Shawn O. Pearce1-0/+29
In one particular case I have a tool called 'miga' which users may need to invoke on their repository. This is a homegrown tool which is not (and should be) part of git-gui, but I still want to be able to run it from within the gui. Right now I'm taking a shortcut and adding it to the Tools menu if we are not on Mac OS X and the support script used to launch the tool exists in the local filesystem. This is nothing but a complete and utter hack. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-01-21git-gui: Reworded 'Include' to 'Add' to match core Git.Libravatar Shawn O. Pearce1-3/+3
Now that git-add is a first class citizen in core Git (Nico's 366bfcb6) users may start to expect the term 'add' to refer to the act of including a file's changes into a commit. So I'm replacing all uses of the term 'Include' in the UI with 'Add'. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2006-11-27git-gui: Auto-update any A? or M? files during rescan.Libravatar Shawn O. Pearce1-2/+2
If the user has partial includes disabled then it doesn't matter what state the working directory is in; if the file has been included in the next commit its index state is A or M and we should immediately run update-index on the working directory file to bring the index in sync with the working directory. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2006-11-27git-gui: Enable resolution of merge conflicts.Libravatar Shawn O. Pearce1-0/+3
If a file has a merge conflict (index state = U) the user will need to run update-index on that file to resolve all stages down to stage 0, by including the file in the working directory. Like core Git we'll just trust the user that their resolution is correct, and that they didn't just include the file into the commit while merge conflicts still exist within the file. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2006-11-25git-gui: Updated todo list.Libravatar Shawn O. Pearce1-5/+15
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2006-11-25git-gui: Set a proper title on our revert confirm dialog box.Libravatar Shawn O. Pearce1-2/+7
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2006-11-25git-gui: Started implementation of switch_branch.Libravatar Shawn O. Pearce1-1/+50
This implementation of switch_branch is not yet finished, and thus it throws a "NOT FINISHED" error rather than completing the switch. But its a rough sketch of the procedure required. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2006-11-25git-gui: Misc. comment and formatting cleanups.Libravatar Shawn O. Pearce1-7/+10
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2006-11-25git-gui: Rename all_branches -> all_heads.Libravatar Shawn O. Pearce1-8/+8
Since this list is really the set of refs which match "refs/heads/*" it really is the set of heads and not necessarily the set of all branches, as the remote tracking branches are not listed in this set, even if it appears in the "refs/heads/*" namespace (e.g. an old style repository). Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2006-11-25git-gui: Automatically skip tracking branches in branch menu.Libravatar Shawn O. Pearce1-9/+37
Since the user should not work on a tracking branch we automatically hide any branch which is used as a tracking branch by either a remote.<name>.fetch config entry or by a Pull: line in a remotes file. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2006-11-25git-gui: Abort on not implemented branch switching.Libravatar Shawn O. Pearce1-1/+5
I'm not currently ready to implement branch switching, so I'm just going to punt on it for now. :-) Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2006-11-25git-gui: Parse off refs/remotes when showing current branch.Libravatar Shawn O. Pearce1-1/+1
Even though the user shouldn't have a remote branch checked out, if they do we should still show as short of the branch name as possible. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2006-11-24git-gui: Created Branch menu.Libravatar Shawn O. Pearce1-0/+61
This is an early start at branch management from within git-gui. The branch menu has create/delete command entries to create and delete branches as well as a list of radiobutton entries for each branch found in the repository through for-each-ref. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2006-11-24git-gui: Support file state MD (modified/deleted).Libravatar Shawn O. Pearce1-0/+3
Apparently I missed the file state MD, which is a file modified and updated in the index but then removed from the working directory. This should be treated just like AD, an added file which has been deleted from the working directory. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2006-11-24git-gui: Display the current branch.Libravatar Shawn O. Pearce1-1/+30
Users want to know what branch they are sitting on before making a commit, as they may need to switch to a different branch first. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2006-11-23git-gui: Added revert changes command.Libravatar Shawn O. Pearce1-7/+177
Users sometimes need to be able to throw away locally modified files in order to go back to the last committed version of that file. To perform a revert the user must first uninclude each file from the new commit as the working file must at least partially match the index, and we use git-checkout-index to update the working directory. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2006-11-22git-gui: Improve pull error dialogs.Libravatar Shawn O. Pearce1-7/+11
Just like prior to a commit its only an informational message that we refuse to perform a pull on a dirty working directory. Therefore we should not use an error icon. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>