Index: /trunk/src/org/openstreetmap/josm/actions/UploadAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/UploadAction.java	(revision 1574)
+++ /trunk/src/org/openstreetmap/josm/actions/UploadAction.java	(revision 1575)
@@ -9,4 +9,5 @@
 import java.util.Collection;
 import java.util.LinkedList;
+import java.util.List;
 
 import javax.swing.JLabel;
@@ -15,5 +16,4 @@
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
-import javax.swing.JTextField;
 
 import org.openstreetmap.josm.Main;
@@ -22,8 +22,10 @@
 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
+import org.openstreetmap.josm.gui.historycombobox.StringUtils;
+import org.openstreetmap.josm.gui.historycombobox.SuggestingJHistoryComboBox;
 import org.openstreetmap.josm.io.OsmServerWriter;
 import org.openstreetmap.josm.tools.GBC;
+import org.openstreetmap.josm.tools.Shortcut;
 import org.xml.sax.SAXException;
-import org.openstreetmap.josm.tools.Shortcut;
 
 /**
@@ -36,12 +38,7 @@
  */
 public class UploadAction extends JosmAction {
+    
+    public static final String HISTORY_KEY = "upload.comment.history"; 
 
-    /**
-     * Last commit message used for uploading changes.
-     * FIXME save this in preferences, or even offer list of 10 last recently used comments?
-     * FIXME ugly hack; value is filled here and retrieved in the OsmApi class; find better way
-     */
-    public static String lastCommitComment; 
-    
     /** Upload Hook */
     public interface UploadHook {
@@ -108,5 +105,8 @@
                 
                 p.add(new JLabel(tr("Provide a brief comment for the changes you are uploading:")), GBC.eol().insets(0, 5, 10, 3));
-                final JTextField cmt = new JTextField(lastCommitComment);
+                SuggestingJHistoryComboBox cmt = new SuggestingJHistoryComboBox();
+                List<String> cmtHistory = StringUtils.stringToList(Main.pref.get(HISTORY_KEY), SuggestingJHistoryComboBox.DELIM);
+                cmt.setHistory(cmtHistory);
+                //final JTextField cmt = new JTextField(lastCommitComment);
                 p.add(cmt, GBC.eol().fill(GBC.HORIZONTAL));
 
@@ -124,5 +124,8 @@
                     if (cmt.getText().trim().length() < 3) continue;
                     
-                    lastCommitComment = cmt.getText().trim();
+                    // store the history of comments
+                    cmt.addCurrentItemToHistory();
+                    Main.pref.put(HISTORY_KEY, StringUtils.listToString(cmt.getHistory(), SuggestingJHistoryComboBox.DELIM));
+                    
                     break;
                 }
Index: /trunk/src/org/openstreetmap/josm/gui/historycombobox/ComboBoxHistory.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/historycombobox/ComboBoxHistory.java	(revision 1575)
+++ /trunk/src/org/openstreetmap/josm/gui/historycombobox/ComboBoxHistory.java	(revision 1575)
@@ -0,0 +1,130 @@
+/* Copyright (c) 2008, Henrik Niehaus
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice, 
+ *    this list of conditions and the following disclaimer in the documentation 
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its 
+ *    contributors may be used to endorse or promote products derived from this 
+ *    software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.gui.historycombobox;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.DefaultComboBoxModel;
+
+public class ComboBoxHistory extends DefaultComboBoxModel implements Iterable<String> {
+
+	private int maxSize = 10;
+	
+	private List<HistoryChangedListener> listeners = new ArrayList<HistoryChangedListener>();
+	
+	public ComboBoxHistory(int size) {
+		maxSize = size;
+	}
+	
+	/**
+	 * Adds or moves an element to the top of the history
+	 */
+	public void addElement(Object o) {
+		String newEntry = (String)o;
+		
+		// if history contains this object already, delete it,
+		// so that it looks like a move to the top
+		for (int i = 0; i < getSize(); i++) {
+			String oldEntry = (String) getElementAt(i);
+			if(oldEntry.equals(newEntry)) {
+				removeElementAt(i);
+			}
+		}
+		
+		// insert element at the top
+		insertElementAt(o, 0);
+		
+		// remove an element, if the history gets too large
+		if(getSize()> maxSize) {
+			removeElementAt(getSize()-1);
+		}
+		
+		// set selected item to the one just added
+		setSelectedItem(o);
+		
+		fireHistoryChanged();
+	}
+	
+	public Iterator<String> iterator() {
+		return new Iterator<String>() {
+
+			private int position = -1;
+			
+			public void remove() {
+				removeElementAt(position);
+			}
+
+			public boolean hasNext() {
+				if(position < getSize()-1 && getSize()>0) {
+					return true;
+				}
+				return false;
+			}
+
+			public String next() {
+				position++;
+				return getElementAt(position).toString();
+			}
+			
+		};
+	}
+
+	public void setItems(List<String> items) {
+	    removeAllElements();
+	    Collections.reverse(items);
+	    for (String item : items) {
+            addElement(item);
+        }
+	    Collections.reverse(items);
+	}
+	
+    public List<String> asList() {
+        List<String> list = new ArrayList<String>(maxSize);
+        for (String item : this) {
+            list.add(item);
+        }
+        return list;
+    }
+    
+    public void addHistoryChangedListener(HistoryChangedListener l) {
+        listeners.add(l);
+    }
+    
+    public void removeHistoryChangedListener(HistoryChangedListener l) {
+        listeners.remove(l);
+    }
+    
+    private void fireHistoryChanged() {
+        for (HistoryChangedListener l : listeners) {
+            l.historyChanged(asList());
+        }
+    }
+}
Index: /trunk/src/org/openstreetmap/josm/gui/historycombobox/EventConsumingPlainDocument.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/historycombobox/EventConsumingPlainDocument.java	(revision 1575)
+++ /trunk/src/org/openstreetmap/josm/gui/historycombobox/EventConsumingPlainDocument.java	(revision 1575)
@@ -0,0 +1,74 @@
+/* Copyright (c) 2008, Henrik Niehaus
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice, 
+ *    this list of conditions and the following disclaimer in the documentation 
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its 
+ *    contributors may be used to endorse or promote products derived from this 
+ *    software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.gui.historycombobox;
+
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.UndoableEditEvent;
+import javax.swing.text.PlainDocument;
+
+public class EventConsumingPlainDocument extends PlainDocument {
+	private boolean consumeEvents;
+
+	public boolean isConsumeEvents() {
+		return consumeEvents;
+	}
+
+	public void setConsumeEvents(boolean consumeEvents) {
+		this.consumeEvents = consumeEvents;
+	}
+
+	@Override
+	protected void fireChangedUpdate(DocumentEvent e) {
+		if(!consumeEvents) {
+			super.fireChangedUpdate(e);
+		}
+	}
+
+	@Override
+	protected void fireInsertUpdate(DocumentEvent e) {
+		if(!consumeEvents) {
+			super.fireInsertUpdate(e);
+		}
+	}
+
+	@Override
+	protected void fireRemoveUpdate(DocumentEvent e) {
+		if(!consumeEvents) {
+			super.fireRemoveUpdate(e);
+		}
+	}
+
+	@Override
+	protected void fireUndoableEditUpdate(UndoableEditEvent e) {
+		if(!consumeEvents) {
+			super.fireUndoableEditUpdate(e);
+		}
+	}
+	
+	
+}
Index: /trunk/src/org/openstreetmap/josm/gui/historycombobox/HistoryChangedListener.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/historycombobox/HistoryChangedListener.java	(revision 1575)
+++ /trunk/src/org/openstreetmap/josm/gui/historycombobox/HistoryChangedListener.java	(revision 1575)
@@ -0,0 +1,34 @@
+/* Copyright (c) 2008, Henrik Niehaus
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice, 
+ *    this list of conditions and the following disclaimer in the documentation 
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its 
+ *    contributors may be used to endorse or promote products derived from this 
+ *    software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.gui.historycombobox;
+
+import java.util.List;
+
+public interface HistoryChangedListener {
+    public void historyChanged(List<String> history);
+}
Index: /trunk/src/org/openstreetmap/josm/gui/historycombobox/JHistoryComboBox.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/historycombobox/JHistoryComboBox.java	(revision 1575)
+++ /trunk/src/org/openstreetmap/josm/gui/historycombobox/JHistoryComboBox.java	(revision 1575)
@@ -0,0 +1,95 @@
+/* Copyright (c) 2008, Henrik Niehaus
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice, 
+ *    this list of conditions and the following disclaimer in the documentation 
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its 
+ *    contributors may be used to endorse or promote products derived from this 
+ *    software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.gui.historycombobox;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.List;
+
+import javax.swing.JComboBox;
+
+/**
+ * Extends the standard JComboBox with a history. Works with Strings only. 
+ * @author henni
+ *
+ */
+public class JHistoryComboBox extends JComboBox implements ActionListener {
+
+    public static String DELIM = "§§§";
+    
+    protected ComboBoxHistory model;
+    
+    /**
+     * Default constructor for GUI editors. Don't use this!!!
+     */
+    public JHistoryComboBox() {}
+    
+    /**
+     * @param history the history as a list of strings
+     */
+    public JHistoryComboBox(List<String> history) {
+        model = new ComboBoxHistory(15);
+        setModel(model);
+        getEditor().addActionListener(this);
+        setEditable(true);
+        setHistory(history);
+    }
+    
+    public void actionPerformed(ActionEvent e) {
+        addCurrentItemToHistory();
+    }
+
+    public void addCurrentItemToHistory() {
+        String regex = (String)getEditor().getItem();
+        model.addElement(regex);
+    }
+    
+    public void setText(String text) {
+    	getEditor().setItem(text);
+    }
+    
+    public String getText() {
+    	return getEditor().getItem().toString();
+    }
+    
+    public void addHistoryChangedListener(HistoryChangedListener l) {
+        model.addHistoryChangedListener(l);
+    }
+    
+    public void removeHistoryChangedListener(HistoryChangedListener l) {
+        model.removeHistoryChangedListener(l);
+    }
+    
+    public void setHistory(List<String> history) {
+        model.setItems(history);
+    }
+    
+    public List<String> getHistory() {
+        return model.asList();
+    }
+}
Index: /trunk/src/org/openstreetmap/josm/gui/historycombobox/StringUtils.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/historycombobox/StringUtils.java	(revision 1575)
+++ /trunk/src/org/openstreetmap/josm/gui/historycombobox/StringUtils.java	(revision 1575)
@@ -0,0 +1,30 @@
+package org.openstreetmap.josm.gui.historycombobox;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+public class StringUtils {
+    public static List<String> stringToList(String string, String delim) {
+        List<String> list = new ArrayList<String>();
+        if(string != null && delim != null) {
+            String[] s = string.split(delim);
+            for (String str : s) {
+                list.add(str);
+            }
+        }
+        return list;
+    }
+    
+    public static String listToString(List<String> list, String delim) {
+        if(list != null && list.size() > 0) {
+            Iterator<String> iter = list.iterator();
+            StringBuilder sb = new StringBuilder(iter.next());
+            while(iter.hasNext()) {
+                sb.append(delim).append(iter.next());
+            }
+            return sb.toString();
+        }
+        return "";
+    }
+}
Index: /trunk/src/org/openstreetmap/josm/gui/historycombobox/SuggestingJHistoryComboBox.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/historycombobox/SuggestingJHistoryComboBox.java	(revision 1575)
+++ /trunk/src/org/openstreetmap/josm/gui/historycombobox/SuggestingJHistoryComboBox.java	(revision 1575)
@@ -0,0 +1,128 @@
+/* Copyright (c) 2008, Henrik Niehaus
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice, 
+ *    this list of conditions and the following disclaimer in the documentation 
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its 
+ *    contributors may be used to endorse or promote products derived from this 
+ *    software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.gui.historycombobox;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JTextField;
+import javax.swing.text.AbstractDocument;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.BadLocationException;
+import javax.swing.text.DocumentFilter;
+import javax.swing.text.JTextComponent;
+
+public class SuggestingJHistoryComboBox extends JHistoryComboBox implements KeyListener {
+
+	private EventConsumingPlainDocument doc = new EventConsumingPlainDocument();
+	
+    public SuggestingJHistoryComboBox(List<String> history) {
+        super(history);
+
+        // add keylistener for ctrl + space
+        getEditor().getEditorComponent().addKeyListener(this);
+        
+        // add specialized document, which can consume events, which are
+        // produced by the suggestion
+        ((JTextComponent)getEditor().getEditorComponent()).setDocument(doc);
+        
+        // add DocumentFilter to trigger suggestion
+        JTextField editor = (JTextField) getEditor().getEditorComponent();
+        final AbstractDocument doc = (AbstractDocument) editor.getDocument();
+        doc.setDocumentFilter(new DocumentFilter() {
+			@Override
+			public void insertString(FilterBypass fb, int offset,
+					String string, AttributeSet attr)
+					throws BadLocationException {
+				super.insertString(fb, offset, string, attr);
+				if(doc.getLength() > 0) {
+					suggest();
+				}
+			}
+
+			@Override
+			public void replace(FilterBypass fb, int offset, int length,
+					String text, AttributeSet attrs)
+					throws BadLocationException {
+				super.replace(fb, offset, length, text, attrs);
+				if(doc.getLength() > 0) {
+					suggest();
+				}
+			}
+        });
+    }
+
+    public SuggestingJHistoryComboBox() {
+        this(new ArrayList<String>());
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent e) {
+        if(e.getSource() instanceof JTextField) {
+            JTextField textField = (JTextField) e.getSource();
+    
+            // if the ActionCommand equals SUGGEST, the user confirms a suggestion
+            if("SUGGEST".equals(e.getActionCommand())) {
+                textField.setSelectionStart(textField.getText().length());
+                textField.setSelectionEnd(textField.getText().length());
+                textField.setActionCommand("");
+            } else { // the user has finished the input
+                super.actionPerformed(e);
+            }
+        }
+    }
+
+    private void suggest() {
+		JTextField textField = (JTextField) getEditor().getEditorComponent();
+		String text = textField.getText();
+
+		// suggest text
+		for (String suggestion : super.model) {
+			if (suggestion.startsWith(text)) {
+				textField.setActionCommand("SUGGEST");
+				doc.setConsumeEvents(true);
+				textField.setText(suggestion);
+				textField.setSelectionStart(text.length());
+				textField.setSelectionEnd(textField.getText().length());
+				doc.setConsumeEvents(false);
+				break;
+			}
+		}
+	}
+    
+    public void keyReleased(KeyEvent e) {
+    	if(e.getKeyCode() == KeyEvent.VK_SPACE && e.isControlDown()) {
+        	suggest();
+        } 
+    }
+    public void keyPressed(KeyEvent e) {}
+    public void keyTyped(KeyEvent e) {}
+}
Index: /trunk/src/org/openstreetmap/josm/gui/historycombobox/SuggestionListener.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/historycombobox/SuggestionListener.java	(revision 1575)
+++ /trunk/src/org/openstreetmap/josm/gui/historycombobox/SuggestionListener.java	(revision 1575)
@@ -0,0 +1,37 @@
+/* Copyright (c) 2008, Henrik Niehaus
+ * All rights reserved.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice, 
+ *    this list of conditions and the following disclaimer in the documentation 
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of the project nor the names of its 
+ *    contributors may be used to endorse or promote products derived from this 
+ *    software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.openstreetmap.josm.gui.historycombobox;
+
+public interface SuggestionListener {
+
+	/**
+	 * Invoked, if an attempt to suggest text has been made
+	 * @param suggestion The suggested text or null if no suggestion could be found
+	 */
+	public void suggested(String suggestion);
+}
Index: /trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java	(revision 1574)
+++ /trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java	(revision 1575)
@@ -6,4 +6,5 @@
 import java.util.Collection;
 import java.util.LinkedList;
+import java.util.List;
 
 import javax.swing.JOptionPane;
@@ -13,4 +14,6 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.visitor.NameVisitor;
+import org.openstreetmap.josm.gui.historycombobox.JHistoryComboBox;
+import org.openstreetmap.josm.gui.historycombobox.StringUtils;
 
 /**
@@ -78,5 +81,13 @@
         // create changeset if required
         try {
-            if (useChangesets) api.createChangeset(UploadAction.lastCommitComment);
+            if (useChangesets) {
+                // add the last entered comment to the changeset
+                String cmt = "";
+                List<String> history = StringUtils.stringToList(Main.pref.get(UploadAction.HISTORY_KEY), JHistoryComboBox.DELIM);
+                if(history.size() > 0) {
+                    cmt = history.get(0);
+                }
+                api.createChangeset(cmt);
+            }
         } catch (OsmTransferException ex) {
             dealWithTransferException(ex);
