1. 03 8月, 2007 1 次提交
    • S
      git-gui: Avoid Tcl error in popup menu on diff viewer · a13ee29b
      Shawn O. Pearce 提交于
      If there is no path currently shown in the diff viewer then we
      were getting Tcl errors anytime the user right-clicked on the
      diff viewer to bring up its popup menu.  The bug here is caused
      by trying to get the file_state for the empty string; this path
      is never seen so we never have file_state for it.  In such cases
      we now disable the Stage Hunk For Commit option.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      a13ee29b
  2. 30 7月, 2007 4 次提交
    • S
      git-gui: Minor refactoring of merge command line in merge support · 84f67537
      Shawn O. Pearce 提交于
      This is just a small code movement to cleanup how we generate
      the command line for a merge.  I'm only doing it to make the
      next series of changes slightly more readable.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      84f67537
    • S
      git-gui: Use more modern looking icons in the tree browser · dac70892
      Shawn O. Pearce 提交于
      This is a replacement of all of the icons in our tree browser
      window, as the prior icons just looked too 1980s Tk-ish.  The
      icons used here are actually from a KDE themed look, so they
      might actually be familiar to some users of git-gui.
      
      Aside from using more modern looking icons we now have a special
      icon for executable blobs, to make them stand out from the normal
      non-executable blobs.  We also denote symlinks now with a different
      icon, so they stand out from the other types of objects in the tree.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      dac70892
    • S
      git-gui: Don't offer to stage hunks from untracked files · 37e2199c
      Shawn O. Pearce 提交于
      If the user looks at an untracked file in our diff pane we used
      to offer "Stage Hunk For Commit" in the context menu when they
      right-clicked in that pane.  The problem is we don't actually
      have any diff hunks in untracked files, so there is nothing to
      really select for staging.  So we now grey out the menu item,
      so the user cannot invoke it and think its broken when it does
      not perform any useful action.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      37e2199c
    • S
      git-gui: Make sure remotes are loaded when picking revisions · 95af4d8d
      Shawn O. Pearce 提交于
      If we are started for only a blame/browser/citool run we don't
      usually initialize the list of remotes, or determine which refs
      are tracking branches and which are local branch heads.  This is
      because some of that work is relatively expensive and is usually
      not going to be needed if we are started only for a blame, or to
      make a single commit.
      
      However by not loading the remote configuration we were crashing
      if the user tried to open a browser for another branch through
      the Repository menu, as our load_all_heads procedure was unable
      to decide which refs/heads/ items were actually local heads.  We
      now force all remote configuration data to be loaded if we have
      not done so already and we are trying to create a revision mega
      widget.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      95af4d8d
  3. 29 7月, 2007 3 次提交
  4. 27 7月, 2007 1 次提交
    • S
      git-gui: Don't kill modified commit message buffer with merge templates · 1e0a92fd
      Shawn O. Pearce 提交于
      If the user is in the middle of a merge and has already started to
      modify their commit message we were losing the user's changes when
      they pressed 'Rescan' after resolving issues or making changes in
      the working directory.
      
      The problem here was our background timer that saves the commit
      message buffer.  It marks the commit message buffer as not being
      modified when it writes it out to disk, so during the rescan we
      assumed the buffer should be replaced with what we read from the
      MERGE_MSG file.  So we now only read these files from .git if we
      have a valid backup file.  Since we clear it on commit this will
      only have an impact while the user is actively editing the current
      commit.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      1e0a92fd
  5. 25 7月, 2007 7 次提交
    • S
      git-gui: Remove usernames from absolute SSH urls during merging · bc318ea8
      Shawn O. Pearce 提交于
      If we are being asked to merge a tracking branch that comes from a
      remote repository accessed by the very common SSH URL format of
      "user@host:/path/to/repo" then we really don't need the username
      as part of the merge message, it only clutters up the history and
      makes things more confusing.  So we instead clip the username part
      off if the local filesystem path is absolute, as its probably not
      going to be an ambiguous URL even when it is missing the username.
      
      On the other hand we cannot clip the username off if the URL is
      not absolute, because in such cases (e.g. "user@host:myrepo") the
      directory that the repository path is resolved in is relative to
      the user's home directory, and the username becomes important.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      bc318ea8
    • S
      git-gui: Format tracking branch merges as though they were pulls · ead49f5a
      Shawn O. Pearce 提交于
      If we are merging a tracking branch we know exactly what remote URL
      that branch is fetched from, and what its name is on that remote
      repository.  In this case we can setup a merge message that looks
      just like a standard `git-pull $remote $branch` operation by filling
      out FETCH_HEAD before we start git-merge, and then run git-merge just
      like git-pull does.
      
      I think the result of this behavior is that merges look a lot nicer
      when the came off of local tracking branches, because they no longer
      say "commit 'origin/...'" to describe the commit being merged but
      instead now mention the specific repository we fetched those commits
      from.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      ead49f5a
    • S
      git-gui: Cleanup bindings within merge dialog · 9feefbd2
      Shawn O. Pearce 提交于
      Misc. code cleanups in the merge dialog's binding setup and action
      button creation.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      9feefbd2
    • S
      git-gui: Replace merge dialog with our revision picker widget · 350a35f0
      Shawn O. Pearce 提交于
      Now that we only support merging one branch we can offer the user
      a better user interface experience by allowing them to select the
      revision they want to merge through our revision picking widget.
      
      This change neatly solves the problem of locating a branch out of
      a sea of 200 tracking branches, and of dealing with very long branch
      names that all have a common prefix.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      350a35f0
    • S
      git-gui: Show ref last update times in revision chooser tooltips · becafaac
      Shawn O. Pearce 提交于
      If we can we now show the last modification date of a loose ref as
      part of the tooltip information shown in the revision picker.  This
      gives the user an indication of when was the last time that the ref
      was modified locally, and may especially be of interest when looking
      at a tracking branch.
      
      If we cannot find the loose ref file than we try to fallback on the
      reflog and scan it for the date of the last record.  We don't start
      with the reflog however as scanning it backwards from the end is not
      an easy thing to do in Tcl.  So I'm being lazy here and just going
      through the entire file, line by line.  Since that is less efficient
      than a single stat system call, its our fallback strategy.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      becafaac
    • S
      git-gui: Display commit/tag/remote info in tooltip of revision picker · 844c3f6f
      Shawn O. Pearce 提交于
      Our revision chooser mega-widget now sets up tooltips for itself so
      that it displays details about a commit (or a tag and the commit
      it refers to) when the user mouses over that line in the filtered
      ref list.  If the item is from a remote tracking branch then we also
      show the remote url and what branch on that remote we fetch from, so
      the user has a clear concept of where that revision data originated.
      
      To help the merge dialog I've also added a new constructor that
      makes the dialog only offer unmerged revisions (those not in HEAD),
      as this allows users to avoid performing merges only to get "Already
      up to date" messages back from core Git.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      844c3f6f
    • S
      git-gui: Save remote urls obtained from config/remotes setup · 30d19905
      Shawn O. Pearce 提交于
      I'm storing the URLs of any pre-configured remote repositories
      that we happen to come across so that we can later use these
      URLs to show to the user in parts of the UI that might care.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      30d19905
  6. 23 7月, 2007 5 次提交
    • S
      git-gui: Avoid unnecessary symbolic-ref call during checkout · 7d5266a7
      Shawn O. Pearce 提交于
      If we are checking out the branch we are already on then there is no
      need to call symbolic-ref to update the HEAD pointer to the "new"
      branch name, it is already correct.
      
      Currently this situation does not happen very often, but it can be
      seen in some workflows where the user always recreates their local
      branch from a remote tracking branch and more-or-less ignores what
      branch he/she is on right now.  As they say, ignorance is bliss.
      
      This case will however become a tad more common when we overload
      checkout_op to actually also perform all of our merges.  In that
      case we will likely see that the branch we want to "checkout" is
      the current branch, as we are actually just merging into it.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      7d5266a7
    • S
      git-gui: Refactor current branch menu items to make i18n easier · a8139888
      Shawn O. Pearce 提交于
      The i18n team has also identified a rather ugly block of code in
      git-gui that is used to make a pair of Repository menu items show
      the current branch name.  This code is difficult to convert to use
      [mc ...] to lookup the translation, so I'm refactoring it into a
      procedure.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      a8139888
    • S
      git-gui: Refactor diff popup into a procedure to ease i18n work · 83751fc1
      Shawn O. Pearce 提交于
      The folks working on the i18n version of git-gui have had some
      trouble trying to convert these English strings into [mc] calls
      due to the double evaluation.  Moving this block into a standard
      procedure eliminates the double evaluation, making their work
      easier.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      83751fc1
    • S
      git-gui: Paper bag fix quitting crash after commit · 9c5a3c77
      Shawn O. Pearce 提交于
      My earlier introduction of the GITGUI_BCK file (which saves the user's
      commit message buffer while they are typing it) broke the Quit function.
      If the user makes a commit we delete the GITGUI_BCK file; if they then
      immediately quit the application we fail to rename the GITGUI_BCK file
      to GITGUI_MSG.  This is because the file does not exist, but our flag
      still says it does.  The root cause is we did not unset the flag during
      commit.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      9c5a3c77
    • S
      git-gui: Clarify meaning of add tracked menu option · e7d7b1a3
      Shawn O. Pearce 提交于
      Junio recently pointed out on the mailing list that our "Add Existing"
      feature is a lot like `git add -u`, which is generally described as
      "(Re)Add Tracked Files".  This came up during discussion of how to
      translate "Add Existing" into Japanese, as the individual working on
      the translation was not quite sure what the option meant and therefore
      had some trouble selecting the best translation.
      
      I'm changing the menu option to "Add Tracked Files To Commit" and the
      button to "Add Tracked".  This should help new users to better understand
      the actions behind those GUI widgets.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      e7d7b1a3
  7. 22 7月, 2007 2 次提交
    • S
      git-gui: Fix unnecessary fast-forward during checkout · 7bd197c7
      Shawn O. Pearce 提交于
      If we are trying to checkout a local branch which is matched to a
      remote tracking branch, but the local branch is newer than the remote
      tracking branch we actually just want to switch to the local branch.
      The local branch is "Already up to date".
      
      Unfortunately we tossed away the local branch's commit SHA-1 and kept
      the remote tracking branch's SHA-1, which meant that the user lost the
      local changes when we updated the working directory.  At least we did
      not update the local branch ref, so the user's data was still intact.
      
      We now toss the tracking branch's SHA-1 and replace with the local
      branch's SHA-1 before the checkout, ensuring that we pass of the right
      tree to git-read-tree when we update the working directory.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      7bd197c7
    • S
      git-gui: Completely remove my Tools/Migrate hack · 854ffd30
      Shawn O. Pearce 提交于
      This menu option of Tools/Migrate has been living inside of git-gui
      as a local hack to support some coworkers of mine.  It has no value
      to anyone outside of my day-job team and never really should have
      been in a release version of git-gui.  So I'm pulling it out, so
      that nobody else has to deal with this garbage.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      854ffd30
  8. 21 7月, 2007 6 次提交
    • S
      git-gui: Internally allow fetch without storing for future pull support · 54febd4f
      Shawn O. Pearce 提交于
      This is actually just an underlying code improvement that has no user
      visible component yet.  UI improvements to actually fetch and merge via
      an arbitrary remote with no tracking branches must still follow to make
      this change useful for the end-user.
      
      Our tracking branch specifications are a Tcl list of three components:
      
        - local tracking branch name
        - remote name/url
        - remote branch name/tag name
      
      This change just makes the first element optional.  If it is an empty
      string we will run the fetch, but have the value be saved only into the
      special .git/FETCH_HEAD, where we can pick it up and use it for this one
      time operation.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      54febd4f
    • S
      git-gui: Skip unnecessary read-tree work during checkout · dba07411
      Shawn O. Pearce 提交于
      I totally missed this obvious optimization in the checkout code path.
      If our current repository HEAD is actually at the commit we are moving
      to, and we agreed to perform this switch earlier, then we have no files
      to update in the working directory and any stale mtimes are simply not
      of consequence right now.  We can pretend like we ran a read-tree and
      skip right into the post-read-tree work, such as updating the branch
      and setting the symbolic-ref.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      dba07411
    • S
      git-gui: Simplify error case for unsupported merge types · eea1ab6e
      Shawn O. Pearce 提交于
      If we are given a merge type we don't understand in checkout_op there
      is probably a bug in git-gui somewhere that allowed this unknown merge
      strategy to come into this part of the code path.  We currently only
      recognize three merge types ('none', 'ff' and 'reset') but are going
      to be supporting more in the future.  Rather than keep editing this
      message I'm going with a very generic "Uh, we don't do that!" type of
      error.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      eea1ab6e
    • S
      git-gui: Factor out common fast-forward merge case · f66b8a68
      Shawn O. Pearce 提交于
      In both the ff and reset merge_types supported by checkout_op the
      result is the same if the merge base of our target commit and the
      existing commit is the existing commit: its a fast-forward as the
      existing commit is fully contained in the target commit.
      
      This minor cleanup in logic will make it easier to implement a
      new kind of merge_type that actually merges the two trees with a
      real merge strategy, such as git-merge-recursive.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      f66b8a68
    • S
      git-gui: Save the merge base during checkout_op processing · 60f7352f
      Shawn O. Pearce 提交于
      I've decided to teach checkout_op how to perform more than just a
      fast-forward and reset type of merge.  This way we can also do a full
      recursive merge even when we are recreating an existing branch from
      a remote.  To help with that process I'm saving the merge-base we
      computed during the ff/reset/fail decision process, in case we need
      it later on when we actually start a true merge operation.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      60f7352f
    • S
      git-gui: Automatically backup the user's commit buffer · 4578c5cb
      Shawn O. Pearce 提交于
      A few users have been seeing crashes in Tk when using the undo key
      binding to undo the last few keystroke events in the commit buffer.
      Unfortunately that means the user loses their commit message and
      must start over from scratch when the user restarts the process.
      
      git-gui now saves the user's commit message buffer every couple of
      seconds to a temporary file under .git (specifically .git/GITGUI_BCK).
      At exit time we rename this file to .git/GITGUI_MSG if there is a
      message, the file exists, and it is currently synchronized with the
      Tk buffer.  Otherwise we do our usual routine of saving the Tk buffer
      to .git/GITGUI_MSG and delete .git/GITGUI_BCK, if it exists.
      
      During startup we favor .git/GITGUI_BCK over .git/GITGUI_MSG.  This
      way a crash doesn't take out the user's message buffer but instead
      will cause the user to lose only a few keystrokes.  Most people do
      not type more than 200 WPM, and with 30 possible saves per minute
      we are unlikely to lose more than 7 words.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      4578c5cb
  9. 19 7月, 2007 6 次提交
  10. 18 7月, 2007 5 次提交