Document search and highlight feature
[qgit4.git] / README
blob181176ab194df0bdeb37fe858280678b6cc84fb9
1 qgit, a git GUI viewer
2 ======================
4 With qgit you will be able to browse revisions history, view patch content
5 and changed files, graphically following different development branches.
7 Bugs or feature requests should be sent to the git@vger.kernel.org
8 mailing list.
10 Main features
11 -------------
13  - View revisions, diffs, files history, files annotation, archive tree.
15  - Commit changes visually cherry picking modified files.
17  - Apply or save patch series from selected commits, drag and
18    drop commits between two instances of qgit.
20  - Associate commands sequences, scripts and anything else executable
21    to a custom action. Actions can be run from menu and corresponding
22    output is grabbed by a terminal window.
24  - qgit implements a GUI for the most common StGIT commands like push/pop
25    and apply/save patches. You can also create new patches or refresh
26    current top one using the same semantics of git commit, i.e. cherry
27    picking single modified files.
30 Installation
31 ------------
33 You need Qt developer libraries, version 4.3 or later, already installed.
34 Be sure compiler, qmake (Qt4 version) and Qt4 bin tools are in path.
36 NOTE: Correct qmake for Qt4 (/usr/lib/qt4/bin/qmake) must be called, in
37 case also Qt3 version is in path the former must be explicitly invoked.
39 To compile, install and start qgit:
41  - unpack the released tar file or clone from a git public archive
43  - (Windows only) open src/src.pro and set the proper GIT_EXEC_DIR value
45  - qmake qgit.pro (only the first time)
47  - (Windows only with VC2008 IDE) open qgit.sln solution file
49  - make
51  - make install
53  - (Windows only) run start_qgit.bat to start the application. You can
54     also create a a desktop icon linked to 'start_qgit.bat' and double
55     click on it.
57 Installation directory is $HOME/bin under Linux and the directory of git
58 exe files under Windows.
60 You need to run 'qmake qgit.pro' only the first time to generate Makefile
61 files, then you simply call 'make' and  'make install'. You may need to
62 run 'qmake qgit.pro' again only after patches that modify 'qgit.pro' or
63 'src/src.pro' files or in case of 'strange' compile errors.
65 Remember to manually delete all Makefile* files in 'src/' directory before to
66 start 'qmake qgit.pro'.
69 Performance tweaks
70 ------------------
72 A 'git log' command is used to load the repository at startup or when
73 refreshing. This is an highly performance critical task. Default method is
74 based on a temporary file as data exchange facility. This is the fastest
75 on Linux with a tmpfs filesystem mounted under /tmp, as is common with most
76 distributions. In case of portability issues it is possible to fallback
77 on a standard QProcess based interface. To do this uncomment USE_QPROCESS
78 define in 'src/dataloader.h' before to compile.
81 Command line arguments
82 ----------------------
83 Run qgit from a git working directory, command line arguments
84 are filtered by 'git log'. Some examples:
86         qgit --no-merges
87         qgit v2.6.18.. include/scsi drivers/scsi
88         qgit --since="2 weeks ago" -- kernel/
89         qgit -r --name-status release..test
91 If qgit is launched without arguments or if you change archive with
92 'open' menu, a dialog for range select is shown.
93 You can select top and bottom rev tags from the list or paste a
94 specific revision. Values are passed to 'git log' to narrow
95 data loading to chosen revisions.
98 Main view
99 ---------
100 You can navigate through logs, file names, file history, archive tree.
101 All the views will be updated accordingly.
103 Copy/paste is supported on all fields. Copy (CTRL+C) is supported on
104 all views.
106 All the references found recursively under .git/refs/ directory are
107 highlighted according to their type: current branch(HEAD), branch, tag,
108 other. Reference names and any associated messages can be viewed in status
109 bar when a tagged revision is selected.
111 When you right click on main view a context sensitive pop-up menu is shows
112 available commands and a 'quick jump' tag list.
114 *Key bindings*::
116 `-------------`----------------------------------
117 r             Go to revisions list page
118 p             Go to patch page
119 f             Go to file page
120 <Alt+wheel>   Go to next/previous page
121 t             Toggle tree view
122 s             Toggle view of secondary panes
123 h             Toggle view of revision header
124 <Home>        Move to first revision
125 <End>         Move to last revision
126 i             Move up one revision in main view (global scope)
127 n, k          Move down one revision in main view (global scope)
128 <Shift-Up>    Move to previous highlighted line
129 <Shift-Down>  Move to next highlighted line
130 <Left>        Go back in history list
131 <Right>       Go forward in history list
132 <CTRL-plus>   Increase font size
133 <CTRL-minus>  Decrease font size
134 <Delete>, b   Scroll content up one page
135 <Backspace>   Scroll content up one page
136 <Space>       Scroll content down one page
137 u             Scroll content up 18 lines
138 d             Scroll content down 18 lines
139 -------------------------------------------------
141 *Directory tree*::
142 From menu or toolbar button it is possible to show a side panel with
143 tree view of repository files and directories.
145 Double clicking on a file opens file annotation window. With 'filter by tree'
146 button it is possible to compress revision list to show only selected
147 files/directories in tree view.
149 Tree view supports multi-selection. When you right click on a file on tree
150 view a context sensitive pop-up menu is shows with available commands.
152 *Working dir changes*::
153 When 'Check working dir' flag is set, as example from main view context
154 pop-up menu, a pseudo-revision is shown and highlighted at the top of the
155 list. Highlight and revision name reflect current working dir status:
156 'Nothing to commit' or 'Working dir changes' respectively.
158 To check for working dir modified files set corresponding preference in
159 Edit->Settings->'Working dir'. QGit checks for possible new files added in
160 working directory using ignoring rules according to git ls-files
161 specifications, see menu Edit->Settings->'Working dir'.
163 TIP: If you don't need to see modified files in working dir, disable
164 corresponding setting and start-up time will be shorter.
166 *Lane info*::
167 Selecting a lane with mouse right button will display a pop-up
168 with the list of children and parent. Select one and you jump to it.
170 *Filter / Highlight*::
171 Use the combo box to select where you want to filter or highlight on.
172 Currently supported fields are: log header, log message, revision author,
173 revision SHA1, file name and patch content.
175 Write a filter string, press filter button and the view
176 will update showing only commits that contain the filter string,
177 case insensitive. Toggle filter button to release the filter.
179 Alternatively press the magnifying glass button, in this case matched
180 lines will be highlighted, you can use <Shift-Up> and <Shift-Down>
181 keys to browse them. Toggle the button to remove the highlighting.
183 NOTE: In case of patch content regexp filtering, the given string is
184 interpreted as a POSIX regular expression, not as a simple substring.
186 TIP: Very useful to quick retrieve a sha writing only first 3-4
187 digits and filtering / highlighting on revision sha. The sha value
188 can then be copied from SHA field.
190 TIP: It is possible to insert an abbreviated sha directly in the
191 SHA line edit at the top right of the window. After pressing enter
192 this will trigger an higlighting of the matched revisions. It is
193 a kind of shortcut of the previous tip.
195 *Save patch series*::
196 After mouse selecting the chosen revisions (use standard CTRL+left click)
197 for single select or SHIFT+left click for range select), press 'Save
198 Patch' button or use file menu and a dialog will let you choose patches
199 destination directory. Then 'git format-patch-script' will be called and
200 patches created. It is possible to specify additional options with
201 Edit->Settings menu.
203 *Apply patch*::
204 This menu entry is complementary to save patch and it's an interface
205 to 'git am'.
207 *Drag and drop*::
208 It is possible to drag some selected revs from one instance of qgit to another
209 open on a different archive. In this case 'git format-patch' is used in the
210 dragging archive to create temporary patches imported in the dropping archive
211 by 'git am'.
213 *Make tag*::
214 Select a revision and open Edit->'Make Tag' or use right click context
215 pop-up menu. Two dialogs will be shown, the first asking for a tag name, the
216 second for a tag message (not mandatory). If a non empty message is written,
217 this will be saved together with the tag. Tags and tag messages can be viewed
218 in status bar when a tagged revision is selected.
220 *Delete tag*::
221 Select a tagged revision and open Edit->'Delete Tag' or use right click
222 context pop-up menu. After confirmation the selected revision will be
223 untagged.
225 *Save file*::
226 Select a file from tree or file list and open File->'Save file as' or use the
227 tree view context sensitive pop-up menu (right click), a dialog will be shown
228 asking for a file name (default to current) and destination directory. Input
229 a valid name, press OK and the file will be saved.
231 *Commit changes*::
232 When enabled with Edit->Settings->'Working dir'->'Diff against working dir'
233 and there is something committable, a special highlighted first revision is
234 shown, with the status of the archive and the possible pending stuff.
235 From Edit->Commit it is then possible to invoke the commit dialog.
237 In commit dialog select the files to commit or, simply, to sync with index
238 (call 'git update-index' on them). A proper commit message may be entered and,
239 after confirmation, changes are committed and a new revision is created.
241 It is also possible to amend last commit. The Edit->Amend commit opens the
242 same dialog, but changes are added to the head commit instead of creating new
243 commit.
245 The core commit function is performed by 'git commit'.
247 TIP: It is possible to use a template for commit message, use
248 Edit->Settings->Commit to define template file path.
251 Patch viewer
252 ------------
253 To open patch tab use context menu, double click on a revision or file in
254 main view or select View->'View patch' menu (CTRL+P). The patch shown is
255 the diff of current selected commit against:
257  - Parent (default)
258  - HEAD
259  - Selected SHA or reference name
261 In the last case SHA is chosen by writing or pasting a tree-ish or a reference
262 names in the corresponding field and pressing return. You get the same result
263 also with a CTRL+right click on a revision in main list. Selected target
264 will be highlighted. CTRL+right click again on the highlighted revision to
265 release the filter.
267 With the 'filter' button at the right of the tool bar it is possible to
268 toggle the display of removed code lines. This can be useful to easy
269 reading of the patch.
271 External diff tool
272 --------------------
274 From 'View->External diff' it is possible to invoke an external diff tool,
275 as example to view the diffs in a two vertical tiled windows.
277 External diff tool shows the diffs between two files.
278 First file is the current selected file of current revision.
279 Second file is the same file of the parent revision or of a specific revision
280 if 'diff to sha' feature is enabled (diff target is highlighted, see above).
282 Default external viewer is kompare, but it is possible to set a preferred one
283 from 'Edit->Settings->External Diff Tool'.
286 File viewer
287 -----------
289 It is possible to view file contents of any file at any revision time in
290 history.
292 *File list panel*::
293 In the bottom right of main view a list of files modified by current
294 revision is shown. Selecting a file name will update the patch view
295 to center on the file. File names colors use the following convention
297  - black for modified files
298  - green for new files
299  - red for removed files
300  - dark blue for renamed/copied files
302 *Merge files*::
303 In case of merges the groups of files corresponding to each merge parent
304 are separated by two empty lines.
306 In case of merges you can chose between to see all the merge files or only
307 the interesting ones (default), i.e. the files modified by more then one
308 merge parent.
310 *File content*::
311 To view file content double click on a file name in tree view, or use context
312 menu in file list or select View->'View file' menu (CTRL+A).
314 In file view page will be shown current revision's file content and file
315 history.
317 It is possible to copy to the clipboard the selected content with CTRL+C or
318 with the corresponding button.
320 *File annotations*::
321 On opening or updating file viewer, file history will be retrieved from archive
322 together with file content. Annotations are then calculated in background
323 and the view is updated when ready.
325 Double clicking on an annotation index number will update history list
326 to point to corresponding revision.
328 Hovering the mouse over an annotation index will show a tool tip with the
329 corresponding revision description.
331 File content will change too, to show new selected revision file. To keep
332 the same view content after double clicking, probably what you want, just pin
333 it with 'Pin view' check button. Next to the check button there is a spinbox
334 to show/select the current revision number.
336 Double click on history list entry to update main, patch and tree views to
337 corresponding revision.
339 *Code region filter*::
340 When annotation info is available the 'filter' button is enabled and it is
341 possible to mouse select a region of file content. Then, when pressing
342 the filter button, only revisions that modify the selected region will be
343 visible. Selected code region is highlighted and a shrunken history is
344 shown. Filter button is a toggle button, so just press it again to
345 release the filter.
347 *Syntax highlighter*::
348 If GNU Source-highlight (http://www.gnu.org/software/src-highlite/) is
349 installed and in PATH then it is possible to toggle source code highlight
350 pressing the 'Color text' tool button. Please refer to Source-highlight
351 site for the list of supported languages and additional documentation.
354 Actions
355 ------
356 Actions can be added/removed using a dedicated dialog invoked
357 from 'Actions->Setup actions...' menu. Actions can be activated
358 clicking on their name from the Actions menu.
360 Each action can be associated to a list of any type of git or shell
361 commands or to an external script.
363 While an action is running a terminal window is shown to display the
364 corresponding output.
366 An action can also ask for command line arguments before to run so
367 to allow for maximum flexibility.
369 NOTE: command line arguments are always appended to the first command only.
370 This lets you define an action like:
372   git fetch
373   git merge
375 And if you type 'origin' when prompted, the action executed will be:
377   git fetch origin
378   git merge
380 If you need a more complex arguments passing with a shell like notation
381 define a script and associate your action to it.
384 Integration with StGIT
385 ----------------------
386 When a StGIT stack is found on top of a git archive, qgit transparently
387 handles the added information.
389 Integration with StGIT is implemented both by new and modified functions.
391 .New functions are automatically activated:
393  - Visualization of applied and unapplied patches in main view.
394  - Interface to push/pop patches by a mouse right click on selected items.
395    Push supports also multi-selection.
397 .Existing functions change behavior:
399  - Amend commit dialog refreshes top stack patch with modified files instead
400    of amending the commit. It is appropriately renamed in the menu.
401  - Commit dialog creates a new patch on the top of the stack filled with
402    modified working directory content instead of commit a new revision to
403    git repository.
404  - Apply patch changes to interface StGIT import and fold commands instead
405    of applying patch directly on the git repository.